Skip to content

WorkflowInput

Base classes

Name Children Inherits
dict
builtins
dict() -> new empty dictionary

⋔ Inheritance diagram

graph TD
  2514019400["input_types.WorkflowInput"]
  2645524081["builtins.dict"]
  2751680898["builtins.object"]
  2645524081 --> 2514019400
  2751680898 --> 2645524081

🛈 DocStrings

Bases: TypedDict

Input for the Workflow tool.

Source code in src/clawd_code_sdk/models/input_types.py
@_extra_allow
class WorkflowInput(TypedDict):
    """Input for the Workflow tool."""

    script: NotRequired[str]
    """Self-contained workflow script.

    Must begin with `export const meta = { name, description, phases }` (pure literal, no computed
    values) followed by the script body using agent()/parallel()/pipeline()/phase().
    """
    name: NotRequired[str]
    """Name of a predefined workflow (built-in or from .claude/workflows/).

    Resolves to a self-contained script.
    """
    description: NotRequired[str]
    """Ignored — set the workflow description in the script's `meta` block."""
    title: NotRequired[str]
    """Ignored — set the workflow title in the script's `meta` block."""
    args: NotRequired[dict[str, Any]]
    """Optional input value exposed to the script as the global `args`, verbatim.

    Pass arrays/objects as actual JSON values, NOT as a JSON-encoded string — a stringified list
    breaks `args.filter`/`args.map` in the script. Use for parameterized named workflows (e.g. a
    research question).
    """
    scriptPath: NotRequired[str]
    """Path to a workflow script file on disk.

    Every Workflow invocation persists its script under the session directory and returns the path
    in the tool result. To iterate, edit that file with Write/Edit and re-invoke Workflow with the
    same `scriptPath` instead of re-sending the full script. Takes precedence over `script` and
    `name`.
    """
    resumeFromRunId: NotRequired[str]
    """Run ID of a prior Workflow invocation to resume from.

    Completed agent() calls with unchanged (prompt, opts) return their cached results instantly;
    only edited or new calls re-run. Same-session only. Stop the prior run first (TaskStop) before
    resuming.
    """

args instance-attribute

args: NotRequired[dict[str, Any]]

Optional input value exposed to the script as the global args, verbatim.

Pass arrays/objects as actual JSON values, NOT as a JSON-encoded string — a stringified list breaks args.filter/args.map in the script. Use for parameterized named workflows (e.g. a research question).

description instance-attribute

description: NotRequired[str]

Ignored — set the workflow description in the script's meta block.

name instance-attribute

name: NotRequired[str]

Name of a predefined workflow (built-in or from .claude/workflows/).

Resolves to a self-contained script.

resumeFromRunId instance-attribute

resumeFromRunId: NotRequired[str]

Run ID of a prior Workflow invocation to resume from.

Completed agent() calls with unchanged (prompt, opts) return their cached results instantly; only edited or new calls re-run. Same-session only. Stop the prior run first (TaskStop) before resuming.

script instance-attribute

script: NotRequired[str]

Self-contained workflow script.

Must begin with export const meta = { name, description, phases } (pure literal, no computed values) followed by the script body using agent()/parallel()/pipeline()/phase().

scriptPath instance-attribute

scriptPath: NotRequired[str]

Path to a workflow script file on disk.

Every Workflow invocation persists its script under the session directory and returns the path in the tool result. To iterate, edit that file with Write/Edit and re-invoke Workflow with the same scriptPath instead of re-sending the full script. Takes precedence over script and name.

title instance-attribute

title: NotRequired[str]

Ignored — set the workflow title in the script's meta block.

:fa-brands-github: Show source on GitHub