Sanity Library Reference Docs
    Preparing search index...

    Child workflows created by an action's spawn, exposed as $subworkflows. definition selects the highest deployed version unless a version is pinned.

    forEach evaluates with workflow fields only and no caller variables, even for a caller-fired action. Rows need unique identities: a nonempty _key, then _id, then a GDR's id, or a scalar's string representation. Missing or duplicate identities reject the spawn. Re-entry adopts matching live children from the same activity, action, and definition instead of duplicating them.

    with maps child input-field names to expressions evaluated with $row. context evaluates once without $row and supplies the child's $context. Both use the parent activity's field scope and the acting identity when available. Neither binds $can, $attributes, or $params. Context results must be strings, numbers, booleans, or full GDRs; null and undefined omit the entry. Other objects and arrays reject the spawn.

    onExit governs live children when their cohort leaves scope: detach (the default) leaves them running; abort stops them recursively. Aborting the parent always stops its children. Parent transitions must separately declare whether they wait for the cohort to settle.

    interface Subworkflows {
        context?: { [key: string]: string };
        definition: { name: string; version?: number | "latest" };
        forEach: string;
        onExit?: "detach" | "abort";
        with?: { [key: string]: string };
    }
    Index

    Properties

    context?: { [key: string]: string } = ...
    definition: { name: string; version?: number | "latest" } = DefinitionRefSchema
    forEach: string = NonEmpty
    onExit?: "detach" | "abort" = ...
    with?: { [key: string]: string } = ...