Skip to content

Self-improving AI Employees for everyone

20.8 KB
Raw Blame
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080" width="100%" role="img" aria-labelledby="title desc">
<title id="title">Durable Deployment and Events</title>
<desc id="desc">A deployment lifecycle and event-flow view showing Start/Pause/Resume/Reset controls, immutable per-generation graph snapshots, the long-lived WorkflowControlWorkflow, push/poll/cron trigger paths, CloudEvents dispatch, and child graph execution. Sources: server/services/deployment/handlers.py; server/services/deployment/control.py; server/services/deployment/triggers.py; server/services/temporal/workflow_control_workflow.py; server/services/events/envelope.py; server/services/events/dispatch.py; server/services/temporal/schedules.py; server/nodes/scheduler/cron_scheduler/_workflow.py; server/services/workflow.py</desc>
<defs>
  <marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="#e8eaed"/></marker>
  <style>
    .title { fill:#e8eaed; font:700 30px Geist,system-ui,sans-serif; }
    .subtitle { fill:#9aa1ac; font:400 18px Geist,system-ui,sans-serif; }
    .group-label { fill:#9aa1ac; font:600 16px 'JetBrains Mono',ui-monospace,monospace; letter-spacing:1.2px; }
    .type-label { fill:#9aa1ac; font:600 16px 'JetBrains Mono',ui-monospace,monospace; letter-spacing:.8px; }
    .node-label { fill:#e8eaed; font:650 20px Geist,system-ui,sans-serif; }
    .node-detail { fill:#9aa1ac; font:400 16px Geist,system-ui,sans-serif; }
    .edge-label { fill:#e8eaed; font:500 16px Geist,system-ui,sans-serif; }
    .edge-protocol { fill:#9aa1ac; font:500 16px 'JetBrains Mono',ui-monospace,monospace; }
    .callout-title { fill:#e8eaed; font:650 18px Geist,system-ui,sans-serif; }
    .callout-text { fill:#9aa1ac; font:400 16px Geist,system-ui,sans-serif; }
    .legend { fill:#9aa1ac; font:500 16px Geist,system-ui,sans-serif; }
  </style>
</defs>
<rect width="1920" height="1080" fill="#0d0f13"/>
<text x="72" y="58" class="title">Durable Deployment and Events</text>
<text x="72" y="91" class="subtitle">Generation snapshots, trigger admission, controller signals and child workflow runs</text>
<g data-group-id="control-plane"><rect x="45" y="145" width="610" height="815" rx="18" fill="#15171c" stroke="#f1fa8c" stroke-width="2"/><text x="65" y="177" class="group-label">DEPLOYMENT CONTROL PLANE</text></g><g data-group-id="trigger-plane"><rect x="690" y="145" width="710" height="815" rx="18" fill="#15171c" stroke="#ff79c6" stroke-width="2"/><text x="710" y="177" class="group-label">TRIGGER AND EVENT PLANE</text></g><g data-group-id="execution-plane"><rect x="1435" y="145" width="440" height="815" rx="18" fill="#15171c" stroke="#ffb86c" stroke-width="2"/><text x="1455" y="177" class="group-label">DURABLE EXECUTION</text></g><g data-relationship-id="r-controls-service"><title>Requests lifecycle transition · via WebSocket command</title><path d="M 340 275.0 L 370 275.0" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="227.8" y="366.0" width="244.39999999999998" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="350" y="387" class="edge-label" text-anchor="middle" textLength="226.4" lengthAdjust="spacingAndGlyphs">Requests lifecycle transition</text><text x="350" y="407" class="edge-protocol" text-anchor="middle">via WebSocket command</text></g><g data-relationship-id="r-service-snapshot"><title>Allocates or CAS-updates · via workflow database</title><path d="M 495.0 345 L 495 405 L 210 405 L 210.0 485" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 350.0 405.0 L 115.19999999999999 405" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="12.0" y="381.0" width="206.39999999999998" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="115.19999999999999" y="402" class="edge-label" text-anchor="middle" textLength="188.4" lengthAdjust="spacingAndGlyphs">Allocates or CAS-updates</text><text x="115.19999999999999" y="422" class="edge-protocol" text-anchor="middle" textLength="188.4" lengthAdjust="spacingAndGlyphs">via workflow database</text></g><g data-relationship-id="r-snapshot-controller"><title>Starts with immutable graph snapshot · via Temporal gRPC</title><path d="M 340 562.5 L 370 562.5" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="201.20000000000002" y="676.0" width="297.59999999999997" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="350" y="697" class="edge-label" text-anchor="middle" textLength="279.6" lengthAdjust="spacingAndGlyphs">Starts with immutable graph snapshot</text><text x="350" y="717" class="edge-protocol" text-anchor="middle">via Temporal gRPC</text></g><g data-relationship-id="r-controls-controller"><title>Updates pause/resume or signals reset · via Temporal Update / Signal</title><path d="M 495.0 345 L 495.0 485" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 495.0 405.0 L 675 405" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="522.4" y="381.0" width="305.2" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="675" y="402" class="edge-label" text-anchor="middle" textLength="287.2" lengthAdjust="spacingAndGlyphs">Updates pause/resume or signals reset</text><text x="675" y="422" class="edge-protocol" text-anchor="middle">via Temporal Update / Signal</text></g><g data-relationship-id="r-service-local-state"><title>Projects admission state · via in-process</title><path d="M 495.0 345 L 640 415 L 640 735 L 355 735 L 355.0 775" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 550.0 735.0 L 640 735" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="536.8" y="711.0" width="206.39999999999998" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="640" y="732" class="edge-label" text-anchor="middle" textLength="188.4" lengthAdjust="spacingAndGlyphs">Projects admission state</text><text x="640" y="752" class="edge-protocol" text-anchor="middle">via in-process</text></g><g data-relationship-id="r-push-event"><title>Normalizes inbound event · via CloudEvents 1.0</title><path d="M 825.0 320 L 855.0 455" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 825.0 385.0 L 1005 385" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="901.8" y="361.0" width="206.39999999999998" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1005" y="382" class="edge-label" text-anchor="middle" textLength="188.4" lengthAdjust="spacingAndGlyphs">Normalizes inbound event</text><text x="1005" y="402" class="edge-protocol" text-anchor="middle">via CloudEvents 1.0</text></g><g data-relationship-id="r-event-dispatch"><title>Emits envelope · via async dispatch</title><path d="M 980 520.0 L 1040 520.0" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="929.6" y="621.0" width="160.79999999999998" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1010" y="642" class="edge-label" text-anchor="middle">Emits envelope</text><text x="1010" y="662" class="edge-protocol" text-anchor="middle" textLength="142.8" lengthAdjust="spacingAndGlyphs">via async dispatch</text></g><g data-relationship-id="r-dispatch-controller"><title>Signals matching controller · via Visibility + on_event</title><path d="M 1040 520.0 L 1010 520 L 675 520 L 620 562.5" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 825.0 520.0 L 735 682" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="620.4" y="658.0" width="229.2" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="735" y="679" class="edge-label" text-anchor="middle" textLength="211.2" lengthAdjust="spacingAndGlyphs">Signals matching controller</text><text x="735" y="699" class="edge-protocol" text-anchor="middle" textLength="211.2" lengthAdjust="spacingAndGlyphs">via Visibility + on_event</text></g><g data-relationship-id="r-poll-controller"><title>Registers durable poll loop · via register_trigger signal</title><path d="M 1045.0 320 L 1045 365 L 675 365 L 675 562 L 620 562.5" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 835.0 365.0 L 1285 365" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="1170.4" y="341.0" width="229.2" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1285" y="362" class="edge-label" text-anchor="middle" textLength="211.2" lengthAdjust="spacingAndGlyphs">Registers durable poll loop</text><text x="1285" y="382" class="edge-protocol" text-anchor="middle" textLength="211.2" lengthAdjust="spacingAndGlyphs">via register_trigger signal</text></g><g data-relationship-id="r-cron-action"><title>Fires scheduled action · via Temporal Schedule</title><path d="M 1360 262.5 L 1415 262 L 1415 642 L 1480 642.5" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 1415.0 465.0 L 1415 519" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="1319.4" y="495.0" width="191.2" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1415" y="516" class="edge-label" text-anchor="middle" textLength="173.2" lengthAdjust="spacingAndGlyphs">Fires scheduled action</text><text x="1415" y="536" class="edge-protocol" text-anchor="middle" textLength="173.2" lengthAdjust="spacingAndGlyphs">via Temporal Schedule</text></g><g data-relationship-id="r-registration-controller"><title>Registers definitions and pause state · via Temporal Signal</title><path d="M 875 805.0 L 675 805 L 675 562 L 620 562.5" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 675.0 720.0 L 675 828" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="522.4" y="804.0" width="305.2" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="675" y="825" class="edge-label" text-anchor="middle" textLength="287.2" lengthAdjust="spacingAndGlyphs">Registers definitions and pause state</text><text x="675" y="845" class="edge-protocol" text-anchor="middle">via Temporal Signal</text></g><g data-relationship-id="r-controller-child"><title>Spawns admitted event or poll run · via Temporal child workflow</title><path d="M 620 562.5 L 1410 562 L 1410 367 L 1480 367.5" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 1225.0 367.0 L 1315 421" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="1177.6" y="397.0" width="274.79999999999995" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1315" y="418" class="edge-label" text-anchor="middle" textLength="256.8" lengthAdjust="spacingAndGlyphs">Spawns admitted event or poll run</text><text x="1315" y="438" class="edge-protocol" text-anchor="middle" textLength="256.8" lengthAdjust="spacingAndGlyphs">via Temporal child workflow</text></g><g data-relationship-id="r-cron-child"><title>Launches snapshotted graph · via Temporal child workflow</title><path d="M 1655.0 570 L 1655.0 440" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="1540.4" y="481.0" width="229.2" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1655" y="502" class="edge-label" text-anchor="middle" textLength="211.2" lengthAdjust="spacingAndGlyphs">Launches snapshotted graph</text><text x="1655" y="522" class="edge-protocol" text-anchor="middle" textLength="211.2" lengthAdjust="spacingAndGlyphs">via Temporal child workflow</text></g><g data-relationship-id="r-child-status"><title>Persists and broadcasts run state · via database + WebSocket</title><path d="M 1655.0 440 L 1655.0 810" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="1517.6" y="736.0" width="274.79999999999995" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1655" y="757" class="edge-label" text-anchor="middle" textLength="256.8" lengthAdjust="spacingAndGlyphs">Persists and broadcasts run state</text><text x="1655" y="777" class="edge-protocol" text-anchor="middle">via database + WebSocket</text></g><g data-relationship-id="r-cron-status"><title>Reports scheduled run state · via Temporal + WebSocket</title><path d="M 1655.0 715 L 1655.0 810" fill="none" stroke="#e8eaed" stroke-width="2" stroke-dasharray="10 8" marker-end="url(#arrow)"/><path d="M 1775.0 760.0 L 1775 966.0" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="1660.4" y="942.0" width="229.2" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1775" y="963.0" class="edge-label" text-anchor="middle" textLength="211.2" lengthAdjust="spacingAndGlyphs">Reports scheduled run state</text><text x="1775" y="983.0" class="edge-protocol" text-anchor="middle" textLength="211.2" lengthAdjust="spacingAndGlyphs">via Temporal + WebSocket</text></g><g data-component-id="lifecycle-controls"><title>Start · Pause · Resume · Reset</title><rect x="80" y="205" width="260" height="140" rx="12" fill="#1b1e25" stroke="#f1fa8c" stroke-width="2"/><rect x="80" y="205" width="260" height="7" rx="4" fill="#f1fa8c"/><text x="98" y="231" class="type-label">OPERATOR CONTROLS</text><text x="98" y="257" class="node-label">Start · Pause</text><text x="98" y="279" class="node-label">Resume · Reset</text><text x="98" y="305" class="node-detail">Revision-aware commands</text></g><g data-component-id="workflow-control-service"><title>WorkflowControlService</title><rect x="370" y="205" width="250" height="140" rx="12" fill="#1b1e25" stroke="#f1fa8c" stroke-width="2"/><rect x="370" y="205" width="250" height="7" rx="4" fill="#f1fa8c"/><text x="388" y="231" class="type-label">CONTROL SERVICE</text><text x="388" y="257" class="node-label" textLength="214.0" lengthAdjust="spacingAndGlyphs">WorkflowControlService</text><text x="388" y="283" class="node-detail" textLength="214.0" lengthAdjust="spacingAndGlyphs">CAS lifecycle transitions</text></g><g data-component-id="generation-snapshot"><title>Generation control row</title><rect x="80" y="485" width="260" height="155" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="80" y="485" width="260" height="7" rx="4" fill="#ff79c6"/><text x="98" y="511" class="type-label">DURABLE DATA</text><text x="98" y="537" class="node-label">Generation control</text><text x="98" y="559" class="node-label">row</text><text x="98" y="585" class="node-detail">graph_snapshot + owner_id</text><text x="98" y="605" class="node-detail">generation + revision</text></g><g data-component-id="controller"><title>WorkflowControlWorkflow</title><rect x="370" y="485" width="250" height="155" rx="12" fill="#1b1e25" stroke="#ffb86c" stroke-width="2"/><rect x="370" y="485" width="250" height="7" rx="4" fill="#ffb86c"/><text x="388" y="511" class="type-label">LONG-LIVED WORKFLOW</text><text x="388" y="537" class="node-label">WorkflowControl</text><text x="388" y="559" class="node-label">Workflow</text><text x="388" y="585" class="node-detail" textLength="214.0" lengthAdjust="spacingAndGlyphs">Signals, poll loops, event queue</text><text x="388" y="605" class="node-detail">continue-as-new</text></g><g data-component-id="local-runtime-state"><title>Local admission state</title><rect x="215" y="775" width="280" height="120" rx="12" fill="#1b1e25" stroke="#ffb86c" stroke-width="2"/><rect x="215" y="775" width="280" height="7" rx="4" fill="#ffb86c"/><text x="233" y="801" class="type-label">PROCESS PROJECTION</text><text x="233" y="827" class="node-label">Local admission state</text><text x="233" y="853" class="node-detail">running / paused projection</text></g><g data-component-id="push-trigger"><title>Push trigger</title><rect x="730" y="205" width="190" height="115" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="730" y="205" width="190" height="7" rx="4" fill="#ff79c6"/><text x="748" y="231" class="type-label" textLength="154.0" lengthAdjust="spacingAndGlyphs">TRIGGER DEFINITION</text><text x="748" y="257" class="node-label">Push trigger</text><text x="748" y="283" class="node-detail" textLength="154.0" lengthAdjust="spacingAndGlyphs">Webhook or platform event</text></g><g data-component-id="poll-trigger"><title>Poll trigger</title><rect x="950" y="205" width="190" height="115" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="950" y="205" width="190" height="7" rx="4" fill="#ff79c6"/><text x="968" y="231" class="type-label" textLength="154.0" lengthAdjust="spacingAndGlyphs">TRIGGER DEFINITION</text><text x="968" y="257" class="node-label">Poll trigger</text><text x="968" y="283" class="node-detail" textLength="154.0" lengthAdjust="spacingAndGlyphs">Controller timer + activity</text></g><g data-component-id="cron-trigger"><title>Cron trigger</title><rect x="1170" y="205" width="190" height="115" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="1170" y="205" width="190" height="7" rx="4" fill="#ff79c6"/><text x="1188" y="231" class="type-label" textLength="154.0" lengthAdjust="spacingAndGlyphs">TRIGGER DEFINITION</text><text x="1188" y="257" class="node-label">Cron trigger</text><text x="1188" y="283" class="node-detail">Temporal Schedule</text></g><g data-component-id="cloudevent"><title>WorkflowEvent</title><rect x="730" y="455" width="250" height="130" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="730" y="455" width="250" height="7" rx="4" fill="#ff79c6"/><text x="748" y="481" class="type-label">CLOUDEVENTS 1.0</text><text x="748" y="507" class="node-label">WorkflowEvent</text><text x="748" y="533" class="node-detail" textLength="214.0" lengthAdjust="spacingAndGlyphs">id · source · type · subject</text></g><g data-component-id="event-dispatch"><title>dispatch.emit</title><rect x="1040" y="455" width="250" height="130" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="1040" y="455" width="250" height="7" rx="4" fill="#ff79c6"/><text x="1058" y="481" class="type-label">EVENT ROUTER</text><text x="1058" y="507" class="node-label">dispatch.emit</text><text x="1058" y="533" class="node-detail" textLength="214.0" lengthAdjust="spacingAndGlyphs">Visibility query + signal</text></g><g data-component-id="trigger-registration"><title>Trigger registration</title><rect x="875" y="745" width="300" height="120" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="875" y="745" width="300" height="7" rx="4" fill="#ff79c6"/><text x="893" y="771" class="type-label">CONTROL SIGNAL</text><text x="893" y="797" class="node-label">Trigger registration</text><text x="893" y="823" class="node-detail">register_trigger + pause flags</text></g><g data-component-id="child-graph-workflow"><title>Child graph workflow</title><rect x="1480" y="295" width="350" height="145" rx="12" fill="#1b1e25" stroke="#ffb86c" stroke-width="2"/><rect x="1480" y="295" width="350" height="7" rx="4" fill="#ffb86c"/><text x="1498" y="321" class="type-label">TEMPORAL WORKFLOW</text><text x="1498" y="347" class="node-label">Child graph workflow</text><text x="1498" y="373" class="node-detail">Snapshotted nodes and edges</text></g><g data-component-id="cron-action-workflow"><title>Cron action workflow</title><rect x="1480" y="570" width="350" height="145" rx="12" fill="#1b1e25" stroke="#ffb86c" stroke-width="2"/><rect x="1480" y="570" width="350" height="7" rx="4" fill="#ffb86c"/><text x="1498" y="596" class="type-label">TEMPORAL WORKFLOW</text><text x="1498" y="622" class="node-label">Cron action workflow</text><text x="1498" y="648" class="node-detail">Schedule-owned graph launch</text></g><g data-component-id="execution-status"><title>Run status and events</title><rect x="1515" y="810" width="280" height="115" rx="12" fill="#1b1e25" stroke="#50fa7b" stroke-width="2"/><rect x="1515" y="810" width="280" height="7" rx="4" fill="#50fa7b"/><text x="1533" y="836" class="type-label">OBSERVABLE RESULT</text><text x="1533" y="862" class="node-label">Run status and events</text><text x="1533" y="888" class="node-detail">Database + WebSocket</text></g><g data-callout-id="legacy-fallback"><rect x="735" y="885" width="630" height="65" rx="10" fill="#1b1e25" stroke="#f1fa8c" stroke-width="2" stroke-dasharray="7 6"/><text x="751" y="915" class="callout-title">Canvas path</text><text x="751" y="941" class="callout-text">Per-node Run waits on the in-memory event_waiter; only Start deploys.</text></g>
<g aria-label="Legend"><circle cx="72" cy="1038" r="7" fill="#bd93f9"/><text x="86" y="1044" class="legend">Agents / system</text><circle cx="317" cy="1038" r="7" fill="#8be9fd"/><text x="331" y="1044" class="legend">Models / interfaces</text><circle cx="562" cy="1038" r="7" fill="#50fa7b"/><text x="576" y="1044" class="legend">Tools / results</text><circle cx="807" cy="1038" r="7" fill="#ff79c6"/><text x="821" y="1044" class="legend">Triggers / events</text><circle cx="1052" cy="1038" r="7" fill="#ffb86c"/><text x="1066" y="1044" class="legend">Workflow / runtime</text><circle cx="1297" cy="1038" r="7" fill="#f1fa8c"/><text x="1311" y="1044" class="legend">Security note</text></g>
</svg>