Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/Make scenario building/Subscenarios
Reference · Make scenario building

Subscenarios

Part of Make scenario building. Install the skill and your agent reads this page when it needs the depth.

Subscenarios and on-demand scenarios

The on-demand shape

A scenario meant to be run on request — from scenario_run, from another scenario, or as an AI agent's tool — has scheduling: {"type": "on-demand"}, a top-level interface: {input: [...], output: [...]}, and exactly this frame:

id 1  scenario-service:StartSubscenario   root: "main"        receives the declared inputs
id 2… whatever the scenario does           follows the previous module
id N  scenario-service:ReturnData          last                produces the declared outputs

The example on-demand-subscenario.json shows the complete call.

Calling one scenario from another

scenario-service:CallSubscenario in the parent: config.parameters.scenario is the child's id, parameters.shouldWaitForExecutionEnd picks synchronous (true — the parent waits and gets the child's declared outputs as this module's output) or fire-and-forget (false — no outputs come back). The mapper's fields are the child's declared inputs; resolve them with module_spec(schemas: true) after the child exists.

Where the outputs actually go

Caller Gets the outputs from
scenario_run on the on-demand scenario its response outputs
a parent's CallSubscenario (sync) that module's output bundle
an AI agent using the scenario as a tool the tool result
an HTTP client posting to a webhook trigger nothing — ReturnData does not reach a webhook caller. End that flow with gateway:WebhookRespond instead

Symptoms of getting it wrong

<!-- Modified by Automation Skills on 2026-11-24: relative links to files that were not copied now point to the original repository. -->

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.