Flows

A Flow is one execution run driven by a set of Goal Steps. Covers the lifecycle (active, terminal, deactivated), how state advances, and how Flows compose through sub-flow Steps.

What is a Flow?

A Flow is one execution run. You specify Goal Steps and initial values, then Argyll plans and executes the work needed to reach those Goals. The same Flow definition can be executed many times with different inputs.

Flow Execution

When you start a Flow:

  1. You provide the Goal Steps you want to achieve
  2. You provide initial state values
  3. Argyll plans what work is required
  4. Argyll executes Steps in parallel where possible
  5. Results are stored in committed state
  6. The Flow advances based only on what it already knows
sequenceDiagram participant Client participant Flow participant Plan participant Execution Client->>Flow: Start (goals, init state) Flow->>Plan: What work is required? Plan-->>Flow: Execution plan Flow->>Execution: Execute plan Execution->>Execution: Run steps in parallel Execution-->>Flow: Results Flow->>Flow: Store committed state Flow-->>Client: Flow completed

Flow Lifecycle

A Flow moves through three phases:

graph TD Active["Active\n(steps executing)"] Terminal["Terminal\n(completed or failed)"] Deactivated["Deactivated\n(no work in flight)"] Active -->|"all goals satisfied"| Terminal Active -->|"Goal Step failed"| Terminal Terminal -->|"all work settles"| Deactivated

Active: Steps are running, events are being recorded, the Flow is progressing toward its Goals.

Terminal (completed or failed): The logical outcome is decided. Either all Goal Steps succeeded, or one failed. No new Steps will start. However, work that was already in flight may still complete and have its results recorded. This is intentional: the audit trail stays complete even after the outcome is known.

Deactivated: Terminal and no pending or active work remains. The Flow is fully settled. Its event log is complete and immutable.

Flow State

Every Flow has explicit state that you can inspect at any time:

  • What Steps have executed and what status they reached
  • What outputs each Step produced
  • What Steps are still pending
  • Why the Flow is in its current state

Reusable Flows

Flows can be packaged as Sub-Flow Steps. This lets you compose complex Flows from simpler ones. A Sub-Flow Step targets a specific set of Goals and maps its outputs back to parent Flow Attributes.