Free Intro Class
    Botspot Logo

    agenthub · workflow.invoke

    Invoke Workflow

    Run another workflow as a single step and get its output back. The invoked workflow stays independently publishable instead of being copy-pasted.

    category Workflowin inputout output · textexecution asyncmodel cost the child workflow's cost

    Why the node earns its place

    The modularity primitive. It is the deterministic counterpart to calling an agent as a tool, but for a private sub-module it runs the child in-process rather than round-tripping through the gateway — no HTTP hop, no subscription gate, and the child's cost folds into the parent's run and is settled once rather than charged per leg.

    Which release of the child runs is decided at publish, not here: publishing freezes the pointer, so the child cannot drift under a parent that was tested against it.

    How it works at run time

    1. 1
      Refuse if the child is already on the invocation chain, or the chain is deeper than the maximum — a naive agent-calling-agent loop would otherwise recurse until timeouts stack.
    2. 2
      Run the child in-process on the parent's usage ledger.
    3. 3
      Return the full envelope, plus the child's reply already extracted.

    What comes out

    output  {ok, result, error, leg_costs} — the full envelope
    text    the child's reply, or null when it produced none

    What you wire

    Inputs

    • input
      object

    Outputs

    • output
      object
    • text
      string

    Configuration

    KeyTypeDefault & optionsWhat it does
    target_agent_id *stringThe workflow (agent) to invoke.
    versionstringdefault "production"'production' (default) tracks the invoked workflow's live release; a concrete release_id pins it. Frozen at publish.

    What usually goes wrong

    Watch for this

    Wire text into Outcome rather than digging the reply out of the envelope. It is null — not an empty string — when the child produced nothing, so a failure reads as a failure instead of sending a silent empty message.

    Behaviour & provenance

    buildersChat & voice agents, Image workflows, Video workflows, Automations
    routesno
    side effectsdelegated
    replay safetydelegated
    talks toanother workflow
    holdsno credentials