Sanity Library Reference Docs
    Preparing search index...

    Fan-out declared as an action's spawn, read back as $subworkflows. forEach is GROQ producing one row per subworkflow (bound as $row); each row needs an identity the engine can adopt on re-entry (_key ?? _id ?? GDR id, or the value itself for a scalar row) or the spawn fails. definition resolves by stable name, ordered version desc unless pinned. with seeds each child's initial fields; context delivers extra parent-scope values into the child's $context. onExit governs only still-live children when the cohort's scope stops applying: 'detach' (default) lets them run to completion, 'abort' kills them recursively — always an authored choice, never automatic. Whether the PARENT may move at all is a separate gate over $subworkflows.

    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 } = ...