A two-layer workflow: the outer workflow classifies user-submitted content asDocumentation Index
Fetch the complete documentation index at: https://docs.sirenspec.dev/llms.txt
Use this file to discover all available pages before exploring further.
safe, borderline, or harmful, then hands off to a nested moderate.yaml child workflow that applies injection and PII guardrails and generates the appropriate response. This pattern separates the routing decision from the response logic — each can evolve independently.
What it demonstrates
workflownode executing a sub-workflow inline- Context isolation: child workflow receives only the keys declared in
inputs {{ inputs.classification }}inside a child workflow’s system prompt- Layering guardrails across parent and child workflows
piiguardrail applied at both levels
Run it
Workflow
Parent (workflow.yaml):
docs/cookbook/content-moderation-pipeline/workflow.yaml
moderate.yaml):
docs/cookbook/content-moderation-pipeline/moderate.yaml
The child workflow’s context starts fresh — it only sees the keys declared in the parent’s
inputs block. The original user message is passed through as the user input automatically; only additional context (like classification) needs to be forwarded explicitly.How data flows
classifyreceives the user’s message and writes a single word (safe,borderline, orharmful) toworking.classify.output.- The
moderateworkflow node resolvesinputs.classificationfrom{{ classify.output }}and launchesmoderate.yamlwith a clean context containing only that value. - Inside
moderate.yaml,responderreads{{ inputs.classification }}from its system prompt and generates the appropriate response. - The child workflow’s
outputdict is written back into the parent atoutput.moderated.
Graph
Next steps
Workflow Nodes
Full reference for sub-workflow composition, context isolation, and the registry API.
Guardrails
Injection, PII, length, schema, and cost-cap guardrail documentation.