Skip to main content

2 posts tagged with "orchestration"

View All Tags

AI Makler — Intelligent Financial Agent With Memory and Multi-Workflow Orchestration

· 5 min read
ApudFlow OS
Platform Updates

Markets move fast, and making sense of them requires not just data but context — what happened yesterday, what decisions you made, how conditions have changed. The AI Makler worker brings that context to life: an intelligent financial agent that remembers past sessions, makes decisions, manages positions, and can even trigger other workflows.

Think of it as a tireless trading assistant that keeps notes on every session and gets smarter the more you use it.

What Is AI Makler?

AI Makler (Polish for "broker") is an AI-powered financial agent that lives in the AI category of the left sidebar. Unlike stateless AI workers that process one request at a time, AI Makler remembers its past analyses, decisions, and market observations across multiple runs within the same workflow.

This makes it ideal for:

  • Continuous market monitoring — the agent knows what it saw yesterday
  • Trading signal generation — it tracks its own accuracy over time
  • Portfolio management — it remembers open positions and reviews them
  • Multi-step workflows — it can trigger other workflows based on analysis

Key Features

🧠 Persistent Memory

  • One MongoDB document per workflow — all runs share the same memory
  • Remembers: market state, analysis, orders, triggered workflows
  • Configurable history (1–100 iterations, default 20)
  • No raw prompts saved — just the meaningful context and decisions

📊 Two Processing Modes

ModePurpose
AnalysisExamine market data and news, identify trends, assess risk
DecisionMake concrete trading calls: buy, sell, close, or hold

📈 Structured Orders

When the agent decides to trade, it returns proper order objects:

{
"action": "buy",
"symbol": "BTCUSD",
"entry_price": 86500.00,
"target_price": 92000.00,
"stop_loss": 84000.00,
"position_size": 0.5,
"order_type": "market",
"reason": "Bullish flag breakout on above-average volume",
"certainty_pct": 82
}

The agent only generates orders when certainty > 60%. If it's not confident, it just returns analysis — no false signals.

🔗 Workflow Orchestration

AI Makler can trigger other workflows to perform complex tasks. List the allowed workflow IDs in the configuration, and the agent will decide when to run them, passing data along. Triggered runs are fire-and-forget via the same Redis queue as manual runs.

💼 Position Management

Pass your current open positions as a JSON array, and the agent will review each one — deciding whether to close, hold, or modify based on current market conditions.

How to Use It

Adding the Worker

  1. Drag AI Makler from the AI category onto your canvas
  2. Connect it after your data sources (or trigger it on a schedule)
  3. Configure the parameters

Configuration

ParameterTypeDescription
modeselectanalysis (default) or decision
datamarkdownMarket data — prices, indicators, volumes
newsmarkdownNews and events
allowedWorkflowstextWorkflow IDs the agent may trigger (one per line)
investorTypeselectaggressive, moderate (default), conservative
instrumentTypesselectall, crypto, forex, stocks, commodities
orderTypesselectmarket, limit, stop-loss, take-profit
currentPositionshiddenJSON array of open positions
maxHistoryIterationsnumber1–100, default 20

Output Fields

FieldTypeWhat it contains
resultsstringFull analysis or decision reasoning
marketStatestringBrief market summary
ordersarrayTrading orders (empty if no decisions)
ordersCountnumberNumber of orders
triggeredWorkflowsarrayWorkflows that were triggered
triggeredCountnumberNumber of workflows triggered
memorySizenumberCurrent history depth
latestActionstringLast order's action (buy/sell/close/hold)
latestSymbolstringLast order's symbol
latestCertaintynumberLast order's confidence

Use Cases

1. Market Monitor With Memory

[Schedule Trigger] → [Fetch Market Data] → [AI Makler: analysis] → [Condition: alert?] → [Telegram Notify]

AI Makler runs every hour, sees how conditions evolved, and sends alerts when patterns change.

2. Signal Generator With Position Tracking

[Schedule] → [Fetch Data + News] → [AI Makler: decision] → [Save Orders to User List]

Agent analyses market data and news, returns buy/sell signals with targets and stop-losses.

3. Portfolio Manager

[Trigger] → [Fetch Positions + Market Data] → [AI Makler: decision] → [Run Workflow "Execute Orders"]

Agent receives current open positions, reviews each one, and decides what to do. The execution workflow handles the actual order placement.

4. Multi-Strategy Coordinator

[Trigger] → [AI Makler: analysis]
→ [Trigger: Run Backtest Workflow]
→ [Trigger: Run Risk Analysis Workflow]

Agent decides which analysis workflows to run based on market conditions, passing relevant data to each.

Memory in Action

When AI Makler runs for the first time, it has clean memory. After each session, it saves:

  • What the market looked like
  • What analysis it produced
  • What orders it generated
  • What workflows it triggered

On the next run, it gets a summary of previous sessions:

PREVIOUS SESSIONS (most recent first):
[1] 2026-06-21T08:00:00 | BTCUSD: Bullish, ETHUSD: Neutral | Orders: 2
[2] 2026-06-20T20:00:00 | BTCUSD: Ranging, high volume | Orders: 1 | Triggered: 1
[3] 2026-06-20T12:00:00 | BTCUSD: Bearish rejection at 88k

This context lets the agent spot trends in its own decision-making and adapt.

This is not financial advice. Trading involves substantial risk of financial loss. The AI Makler worker is a tool for analysis and automation — all trading decisions should be reviewed by a qualified professional. Past performance in memory does not guarantee future results.

Run Workflow — Chain, Orchestrate, and Reuse Workflows Like Building Blocks

· 5 min read
ApudFlow OS
Platform Updates

You've built a library of workflows — data pipelines, signal generators, backtesters, alert senders. Until now, each one ran in isolation. The new Run Workflow worker changes that: trigger any workflow from inside another workflow, pass variables between them, and (optionally) wait for results.

This turns your workflows into reusable building blocks — your data-processing workflow becomes a function call, your backtest runner becomes a sub-process, your entire analysis chain becomes a single parent workflow.

What Is the Run Workflow Worker?

The Run Workflow worker lives in the Flow category of the left sidebar. Drag it onto your canvas, select a target workflow (via autocomplete), optionally pass variables, and choose a mode. That's it.

It's a flow-control node — it orchestrates other workflows rather than processing data itself.

Key Features

  • Autocomplete target selection — search and pick any of your workflows by name
  • Variable passing — send key-value data that becomes available in the target workflow as {{ variable }}
  • Two execution modes — fire-and-forget for parallel execution, wait-for-result for sequential chaining
  • Timeout control — in wait mode, configure how long to wait (10–600 seconds)
  • Full result capture — wait mode returns every node's output from the target workflow

How to Use It

Finding the Worker

Look in the Flow category in the left sidebar, or search for "run workflow". The node shows a play-arrow icon with a gear.

Adding to Your Workflow

  1. Drag the Run Workflow node from the left sidebar onto your canvas
  2. Connect it to preceding nodes (e.g., a trigger or data source)
  3. Click the node — the right panel opens with configuration fields
  4. Select target workflow — the autocomplete field lets you search by name

Configuration

FieldDescription
Target WorkflowSearch and select the workflow to trigger (required)
Modefire-and-forget (default) or wait-for-result
VariablesJSON object with key-value pairs to pass to the target workflow
Timeout(Expert) Max seconds to wait — 10–600, default 300. Only applies in wait mode

Passing Variables

Any variables you pass become available in the target workflow's context. For example, if you pass:

{
"symbol": "BTCUSD",
"timeframe": "1h",
"limit": 200
}

The target workflow can reference them as {{ symbol }}, {{ timeframe }}, and {{ limit }} in any downstream node — just like webhook trigger variables.

Mode Comparison

AspectFire-and-ForgetWait-for-Result
BehaviorTrigger and continue immediatelyTrigger and wait for completion
Use caseParallel execution, fan-outSequential pipelines, data transformation
Outputrun_id for trackingtargetResults with all node outputs
BlockingNo — workflow continuesYes — pauses until target finishes
TimeoutN/AConfigurable (10–600s, default 300s)

Workflow Chaining Patterns

1. Simple Trigger Chain (Fire-and-Forget)

[Manual Trigger] → [Run Workflow "Fetch Data"] → [Run Workflow "Send Alert"]

The parent workflow triggers "Fetch Data" and "Send Alert" — both run independently.

2. Data Pipeline (Wait-for-Result)

[Schedule Trigger] → [Run Workflow "Fetch & Clean Data" (wait)] → [Run Workflow "Generate Signals" (wait)] → [Run Workflow "Store Results"]

Each step waits for the previous one to finish. The parent orchestrates a multi-stage pipeline.

3. Fan-Out / Parallel Processing

[Trigger] → [Run Workflow "Analyze BTC" (fire-and-forget)]
→ [Run Workflow "Analyze ETH" (fire-and-forget)]
→ [Run Workflow "Analyze SOL" (fire-and-forget)]

All three analysis workflows launch simultaneously — great for multi-symbol scans.

4. Reusable Report Generator

[Webhook Trigger] → [Fetch Data] → [Process Signals] → [Run Workflow "Generate Report" (wait)] → [Telegram Notify]

The "Generate Report" workflow is shared across many parent workflows — write once, reuse everywhere.

Financial Markets Applications

Strategy Pipeline

[Schedule Trigger] → [Run Workflow "Fetch OHLCV Data" (wait)]
→ [Run Workflow "Compute Indicators" (wait)]
→ [Run Workflow "Run Backtest" (wait)]
→ [Telegram Send Results]

Chain your data-fetching, indicator, and backtest workflows together. Each is independently testable and reusable.

Multi-Symbol Analysis

[Trigger] → [Parameter Loop] → [Run Workflow "Analyze Symbol"]

Use a Parameter Loop to iterate over symbols, passing each one to a shared analysis workflow via variables. Collect results in a final aggregation step.

Output

Fire-and-Forget

  • run_id — the ID of the triggered run (use to track progress)
  • targetWorkflowName — name of the triggered workflow
  • passedVariables — the variables that were passed along

Wait-for-Result (all of the above, plus)

  • targetStatusfinished, failed, error, or cancelled
  • targetResults — object mapping each node name to its output
  • targetFinishedAt — timestamp of completion

Tips

  • Name your workflows clearly — the autocomplete shows workflow names. Descriptive names make selection faster.
  • Use wait mode for dependencies — if step B needs step A's output, use wait-for-result.
  • Use fire-and-forget for independence — if steps don't depend on each other, let them run in parallel.
  • Watch timeouts — complex target workflows may need more than 300s. Adjust the timeout parameter in expert settings.
  • Variable names matter — pass variables with names that match what the target workflow expects.

This is not financial advice. Trading involves risk of financial loss. The Run Workflow worker is a tool for automation — you are responsible for the logic and outcomes of your workflows.