Use this scenario
Run
Run file_branch_demo scenario.
Use run_scenario with the saved scenario name and string-valued inputs. Required values are requested before execution.
View invocation JSON
{
"scenario_name": "file_branch_demo",
"inputs": {
"first_path": "first.txt",
"second_path": "second.txt"
}
}Watch this version
Inputs
PARAMETERS| Input | Requirement | Default value |
|---|---|---|
first_path | Optional | first.txt |
second_path | Optional | second.txt |
Agent instructions
SYSTEM PROMPTExecute the declared condition and nested scenario. Report only verified workspace results.
Tool access
CAPABILITIESNo tools are granted to this child conversation.
Ordered steps
EXECUTION- 01CONDITION / HOST EVALUATED
Workspace path
{{first_path}}exists = falseTHEN
- 01
ELSE
- 01
Return to main
COPY EXITReturn the verified save receipt unchanged.
The final text returns without model rewriting. Bound operation scenarios return application results; pending changes still require host approval.
Complete XML, including any embedded C#. Copy it without changing the file's contents.
<scenario schemaVersion="2" id="file_branch_demo" title="Two runs, two branches">
<inputs>
<input name="first_path" default="first.txt" />
<input name="second_path" default="second.txt" />
</inputs>
<systemPrompt>Execute the declared condition and nested scenario. Report only verified workspace results.</systemPrompt>
<steps>
<if workspacePath="{{first_path}}" exists="false">
<then>
<run scenario="workspace_save">
<input name="path" value="{{first_path}}" />
<input name="content" value="hello" />
</run>
</then>
<else>
<run scenario="workspace_save">
<input name="path" value="{{second_path}}" />
<input name="content" value="again" />
</run>
</else>
</if>
</steps>
<exit mode="copy">Return the verified save receipt unchanged.</exit>
</scenario>
Every part, briefly.
Short explanations of every element and chat step in this scenario.
- 01Writing example ↗
<scenario>Names and versions the workflow.
- 02Writing example ↗
<inputs>Declares input values.
- 03Writing example ↗
<input>first_pathProvides an optional value.
- 04Writing example ↗
<input>second_pathProvides an optional value.
- 05Writing example ↗
<systemPrompt>Sets the child's instructions.
- 06Writing example ↗
<steps>Orders the chat turns.
- 07Writing example ↗
<if>Checks real workspace state or an input value.
- 08Writing example ↗
<then>Runs when the condition matches.
- 09Writing example ↗
<run>Invokes a fresh saved child scenario.
- 10Writing example ↗
<input>pathBinds a named operation or child input.
- 11Writing example ↗
<input>contentBinds a named operation or child input.
- 12Writing example ↗
<else>Runs when the condition does not match.
- 13Writing example ↗
<run>Invokes a fresh saved child scenario.
- 14Writing example ↗
<input>pathBinds a named operation or child input.
- 15Writing example ↗
<input>contentBinds a named operation or child input.
- 16Writing example ↗
<exit>Returns the output unchanged.