Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1460 1330" width="100%" preserveAspectRatio="xMidYMid meet" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace">
<!-- Palette: OpenCompany dark-theme tokens (client/src/themes/dark.css surfaces/fg + light.css Dracula accents) -->
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="#e8eaed"/>
</marker>
<style>
.bg { fill: #0d0f13; }
.panel { fill: #15171c; stroke-width: 2; }
.p-cyan { stroke: #8be9fd; } .p-purple { stroke: #bd93f9; } .p-orange { stroke: #ffb86c; } .p-green { stroke: #50fa7b; } .p-pink { stroke: #ff79c6; }
.title { fill: #e8eaed; font-size: 20px; font-weight: 700; }
.h1 { fill: #e8eaed; font-size: 18px; font-weight: 700; }
.h2 { fill: #e8eaed; font-size: 14px; font-weight: 700; }
.sub { fill: #e8eaed; font-size: 12px; }
.small { fill: #e8eaed; font-size: 10px; }
.dim { fill: #9aa1ac; font-size: 10px; }
.label { fill: #f1fa8c; font-size: 11px; font-style: italic; }
.conn { stroke: #e8eaed; stroke-width: 1.8; fill: none; }
.conn-dot { stroke: #9aa1ac; stroke-width: 1.5; fill: none; stroke-dasharray: 4 4; }
.box { fill: #1b1e25; stroke-width: 1.5; }
.tier-label { fill: #9aa1ac; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.accent-cyan { fill: #8be9fd; } .accent-purple { fill: #bd93f9; } .accent-green { fill: #50fa7b; } .accent-orange { fill: #ffb86c; } .accent-pink { fill: #ff79c6; }
.title, .h1, .h2 { font-family: 'Geist Variable', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
</style>
</defs>
<rect class="bg" width="1460" height="1330"/>
<!-- Title -->
<text x="40" y="45" class="title">How Workflows Execute</text>
<text x="40" y="68" class="sub">Two entry points -> WorkflowService routing -> one node dispatch path</text>
<!-- Lane labels -->
<text x="250" y="92" class="tier-label" text-anchor="middle">CANVAS RUN PATH</text>
<text x="990" y="92" class="tier-label" text-anchor="middle">DEPLOYED PATH</text>
<!-- Entry box 1: Per-node Run (cyan) -->
<rect class="panel p-cyan" x="40" y="100" width="420" height="96" rx="8"/>
<text x="250" y="130" class="h1" text-anchor="middle">Per-node "Run"</text>
<text x="250" y="156" class="sub" text-anchor="middle">execute_node WS msg -> WorkflowService.execute_node</text>
<text x="250" y="178" class="sub" text-anchor="middle">runs ONE node in-process · no mode routing</text>
<!-- Entry box 2: Toolbar Start (purple) -->
<rect class="panel p-purple" x="780" y="100" width="420" height="96" rx="8"/>
<text x="990" y="130" class="h1" text-anchor="middle">Toolbar "Start"</text>
<text x="990" y="156" class="sub" text-anchor="middle">deploy_workflow WS msg -> DeploymentManager.deploy</text>
<text x="990" y="178" class="sub" text-anchor="middle">graph snapshot persisted · button becomes Pause</text>
<!-- Canvas lane: straight down to convergence -->
<path class="conn" d="M 250 196 L 250 1068" marker-end="url(#arrow)"/>
<text x="262" y="250" class="label">direct dispatch</text>
<text x="270" y="480" class="dim">trigger nodes run on the canvas wait</text>
<text x="270" y="498" class="dim">on the in-memory event_waiter</text>
<text x="270" y="516" class="dim">(asyncio.Future, cancel from the panel)</text>
<text x="270" y="556" class="dim">manual runs persist no conversation</text>
<text x="270" y="574" class="dim">(only Start admits a generation)</text>
<!-- Deployed lane -->
<path class="conn" d="M 990 196 L 990 238" marker-end="url(#arrow)"/>
<rect class="panel p-purple" x="775" y="240" width="430" height="108" rx="8"/>
<text x="990" y="266" class="h2" text-anchor="middle">WorkflowControlWorkflow (per generation)</text>
<text x="990" y="288" class="small" text-anchor="middle">owns Start / Pause / Resume / Reset · re-armed from the snapshot on boot</text>
<text x="990" y="306" class="small" text-anchor="middle">arms one durable listener per trigger node:</text>
<text x="990" y="324" class="small" text-anchor="middle">TriggerListenerWorkflow (push) · PollingTriggerWorkflow (poll)</text>
<text x="990" y="340" class="small" text-anchor="middle">Temporal Schedule (cron, 24 h catch-up window)</text>
<path class="conn" d="M 990 348 L 990 388" marker-end="url(#arrow)"/>
<text x="1002" y="374" class="label">on event</text>
<rect class="panel p-purple" x="775" y="390" width="430" height="90" rx="8"/>
<text x="990" y="416" class="h2" text-anchor="middle">dispatch.emit(CloudEvents envelope)</text>
<text x="990" y="438" class="small" text-anchor="middle">Temporal Visibility query: EventType (and EventWorkflowId) AND Running</text>
<text x="990" y="458" class="small" text-anchor="middle">-> Signal each matching listener · also broadcast to the UI</text>
<path class="conn" d="M 990 480 L 990 520" marker-end="url(#arrow)"/>
<text x="1002" y="506" class="label">Signal</text>
<rect class="panel p-purple" x="775" y="522" width="430" height="72" rx="8"/>
<text x="990" y="548" class="h2" text-anchor="middle">Per-firing child run</text>
<text x="990" y="570" class="small" text-anchor="middle">one child MachinaWorkflow per event - firing trigger pre-executed</text>
<!-- Deployed lane into router -->
<path class="conn" d="M 990 594 L 990 626 L 620 626 L 620 654" marker-end="url(#arrow)"/>
<!-- Router diamond 1 -->
<polygon class="box p-orange" points="620,656 795,718 620,780 445,718"/>
<text x="620" y="714" class="h2" text-anchor="middle">TEMPORAL_ENABLED</text>
<text x="620" y="734" class="h2" text-anchor="middle">and worker wired?</text>
<!-- D1 no -> D2 -->
<path class="conn" d="M 795 718 L 856 718" marker-end="url(#arrow)"/>
<text x="812" y="710" class="label">no</text>
<!-- D1 yes -> Temporal box -->
<path class="conn" d="M 620 780 L 620 806 L 520 806 L 520 846" marker-end="url(#arrow)"/>
<text x="630" y="800" class="label">yes (default)</text>
<!-- Router diamond 2 -->
<polygon class="box p-orange" points="990,663 1120,718 990,773 860,718"/>
<text x="990" y="714" class="h2" text-anchor="middle">REDIS_ENABLED?</text>
<text x="990" y="734" class="small" text-anchor="middle">(default off)</text>
<!-- D2 yes -> Parallel box -->
<path class="conn" d="M 990 773 L 990 806 L 935 806 L 935 846" marker-end="url(#arrow)"/>
<text x="1000" y="798" class="label">yes</text>
<!-- D2 no -> Sequential box -->
<path class="conn" d="M 1120 718 L 1290 718 L 1290 846" marker-end="url(#arrow)"/>
<text x="1140" y="710" class="label">no</text>
<!-- Mode box: Temporal Distributed -->
<rect class="panel p-orange" x="330" y="848" width="380" height="172" rx="8"/>
<text x="520" y="874" class="h2" text-anchor="middle">Temporal Distributed</text>
<text x="520" y="898" class="sub" text-anchor="middle">MachinaWorkflow orchestrator (FIRST_COMPLETED)</text>
<text x="520" y="918" class="sub" text-anchor="middle">node.{type}.v{ver} activities on 9 task queues</text>
<text x="520" y="938" class="sub" text-anchor="middle">RetryPolicy: 3 attempts default · 2 min heartbeat</text>
<text x="520" y="958" class="sub" text-anchor="middle">24 h start-to-close · conditional edges honoured</text>
<text x="520" y="978" class="sub" text-anchor="middle">agents = AgentWorkflow children (LLM step backoff)</text>
<text x="520" y="1002" class="dim" text-anchor="middle">services/temporal/</text>
<!-- Mode box: Parallel Local (Redis) -->
<rect class="panel p-orange" x="760" y="848" width="350" height="152" rx="8"/>
<text x="935" y="874" class="h2" text-anchor="middle">Parallel Local (opt-in)</text>
<text x="935" y="898" class="sub" text-anchor="middle">decide loop + asyncio.wait(FIRST_COMPLETED)</text>
<text x="935" y="918" class="sub" text-anchor="middle">dependents start as soon as their input lands</text>
<text x="935" y="938" class="sub" text-anchor="middle">input-hash cache · DLQ + RecoverySweeper</text>
<text x="935" y="958" class="sub" text-anchor="middle">Redis SETNX locks</text>
<text x="935" y="982" class="dim" text-anchor="middle">services/execution/</text>
<!-- Mode box: Sequential Fallback -->
<rect class="panel p-orange" x="1160" y="848" width="260" height="112" rx="8"/>
<text x="1290" y="874" class="h2" text-anchor="middle">Sequential Fallback</text>
<text x="1290" y="898" class="sub" text-anchor="middle">topological walk</text>
<text x="1290" y="918" class="sub" text-anchor="middle">no cache, no retry, no DLQ</text>
<text x="1290" y="942" class="dim" text-anchor="middle">_execute_sequential()</text>
<!-- Mode boxes -> convergence -->
<path class="conn" d="M 520 1020 L 520 1068" marker-end="url(#arrow)"/>
<path class="conn" d="M 935 1000 L 935 1068" marker-end="url(#arrow)"/>
<path class="conn" d="M 1290 960 L 1290 1117 L 1004 1117" marker-end="url(#arrow)"/>
<!-- Convergence box -->
<rect class="panel p-green" x="220" y="1070" width="780" height="112" rx="8"/>
<text x="610" y="1100" class="h1" text-anchor="middle">NodeExecutor.execute() -> BaseNode.execute()</text>
<text x="610" y="1124" class="sub" text-anchor="middle">plugin registry dispatch · Params validated · log_context + OTel span per node</text>
<text x="610" y="1144" class="sub" text-anchor="middle">Output checked at the serialization boundary · NodeUserError -> one WARN line + error envelope</text>
<text x="610" y="1164" class="sub" text-anchor="middle">-> result dict</text>
<!-- Convergence -> output -->
<path class="conn" d="M 610 1182 L 610 1214" marker-end="url(#arrow)"/>
<!-- Output box -->
<rect class="panel p-green" x="290" y="1216" width="640" height="82" rx="8"/>
<text x="610" y="1244" class="h1" text-anchor="middle">StatusBroadcaster</text>
<text x="610" y="1266" class="sub" text-anchor="middle">node_status + node_output, plus typed CloudEvents (agent_progress, workflow_lifecycle, ...)</text>
<text x="610" y="1286" class="sub" text-anchor="middle">-> frontend WebSocket /ws/status</text>
</svg>