Workflow agents

A workflow agent is the hybrid of the two building blocks. A durable workflow owns the fixed, auditable part of a process, and it hands the open-ended judgment to a conversational agent from inside a step. You get the reliability of a workflow and the flexibility of an agent in one flow.

Each block has a sharp edge on its own. A workflow is durable and deterministic but cannot hold a free-form conversation. An agent reasons through fuzzy input but has no durable pipeline, retries, or audit trail. The hybrid puts the workflow in charge of the spine and lets the agent do the judgment.

Two directions

  • Workflow delegates to an agent (the common case). A step runs one turn of a sibling agent, in-process, and reads back its reply. Because it runs in a 'use step', the reply is a durable checkpoint.

    import { callDeepAgent } from '@stackbone/sdk/workflow';
    
    async function askAgent(message: string) {
      'use step';
      const { text } = await callDeepAgent('support', message);
      return text;
    }

    Use streamDeepAgent instead of callDeepAgent when you want the reply streamed live into the run's chat surface. It runs the same in-process turn and returns the same durable { text }, but the Studio Playground serves the workflow as a token-by-token chat rather than a one-shot run. This is what the stackbone add workflow-agent scaffold generates.

  • Agent starts a workflow. A tool's handler can kick off a long-running workflow with stackbone.workflows.start(name, input) (fire-and-forget) or startAndWait(...) when it needs the result before replying.

When to reach for it

Pick the hybrid when a process has both a rigid backbone and a soft, judgment-heavy middle: triage then act, draft then approve, or answer now and enrich in the background. If it is a pure conversation, use a plain agent. If it is a fixed pipeline, use a plain workflow.

Scaffold the whole thing in one command:

stackbone add workflow-agent lead-qualifier

Where to go next

  • Getting started: scaffold and run a hybrid end to end.
  • Examples: a delegating workflow, an agent that starts a workflow, and a draft-then-approve flow.
  • Agents and Workflows are the two building blocks on their own.

The platform for agent developers.Build, ship and observe agentsthat survive prod.

© 2026 · STACKBONEBUILT WITH ❤️ FROM CANADA AND SPAIN