diff --git a/cli/src/guidance/skills.ts b/cli/src/guidance/skills.ts index d1546a1c8d..60ae2a8506 100644 --- a/cli/src/guidance/skills.ts +++ b/cli/src/guidance/skills.ts @@ -4279,6 +4279,22 @@ The OpenFlow schema (openflow.openapi.yaml) is the source of truth for flow stru - \`flow_input.iter.value\` - Current item when inside a for-loop - \`flow_input.iter.index\` - Current index when inside a for-loop +## Branch Output Rules + +- For \`branchone\`, downstream steps should consume the branch step's result via \`results.branch_step_id\` +- Do NOT reference inner branch module ids from outside the branch container, such as \`results.branch_step_id.some_inner_step\` +- If later steps need a stable fulfillment/result object, make each branch return the same shape and read that from \`results.branch_step_id\` + +Correct downstream access: +\`\`\`json +{"fulfillment": {"type": "javascript", "expr": "results.branch_on_inventory"}} +\`\`\` + +Incorrect downstream access: +\`\`\`json +{"fulfillment": {"type": "javascript", "expr": "results.branch_on_inventory.create_shipment || results.branch_on_inventory.create_backorder"}} +\`\`\` + ## Input Transforms Every rawscript module needs \`input_transforms\` to map function parameters to values: diff --git a/system_prompts/auto-generated/flow.md b/system_prompts/auto-generated/flow.md index 695008cbae..3bc1c28ebc 100644 --- a/system_prompts/auto-generated/flow.md +++ b/system_prompts/auto-generated/flow.md @@ -40,6 +40,22 @@ The OpenFlow schema (openflow.openapi.yaml) is the source of truth for flow stru - `flow_input.iter.value` - Current item when inside a for-loop - `flow_input.iter.index` - Current index when inside a for-loop +## Branch Output Rules + +- For `branchone`, downstream steps should consume the branch step's result via `results.branch_step_id` +- Do NOT reference inner branch module ids from outside the branch container, such as `results.branch_step_id.some_inner_step` +- If later steps need a stable fulfillment/result object, make each branch return the same shape and read that from `results.branch_step_id` + +Correct downstream access: +```json +{"fulfillment": {"type": "javascript", "expr": "results.branch_on_inventory"}} +``` + +Incorrect downstream access: +```json +{"fulfillment": {"type": "javascript", "expr": "results.branch_on_inventory.create_shipment || results.branch_on_inventory.create_backorder"}} +``` + ## Input Transforms Every rawscript module needs `input_transforms` to map function parameters to values: diff --git a/system_prompts/auto-generated/prompts.ts b/system_prompts/auto-generated/prompts.ts index 8fa952625f..530afd73bd 100644 --- a/system_prompts/auto-generated/prompts.ts +++ b/system_prompts/auto-generated/prompts.ts @@ -71,6 +71,22 @@ The OpenFlow schema (openflow.openapi.yaml) is the source of truth for flow stru - \`flow_input.iter.value\` - Current item when inside a for-loop - \`flow_input.iter.index\` - Current index when inside a for-loop +## Branch Output Rules + +- For \`branchone\`, downstream steps should consume the branch step's result via \`results.branch_step_id\` +- Do NOT reference inner branch module ids from outside the branch container, such as \`results.branch_step_id.some_inner_step\` +- If later steps need a stable fulfillment/result object, make each branch return the same shape and read that from \`results.branch_step_id\` + +Correct downstream access: +\`\`\`json +{"fulfillment": {"type": "javascript", "expr": "results.branch_on_inventory"}} +\`\`\` + +Incorrect downstream access: +\`\`\`json +{"fulfillment": {"type": "javascript", "expr": "results.branch_on_inventory.create_shipment || results.branch_on_inventory.create_backorder"}} +\`\`\` + ## Input Transforms Every rawscript module needs \`input_transforms\` to map function parameters to values: diff --git a/system_prompts/auto-generated/skills/write-flow/SKILL.md b/system_prompts/auto-generated/skills/write-flow/SKILL.md index 6f7dec8234..a1fd9a66ba 100644 --- a/system_prompts/auto-generated/skills/write-flow/SKILL.md +++ b/system_prompts/auto-generated/skills/write-flow/SKILL.md @@ -45,6 +45,22 @@ The OpenFlow schema (openflow.openapi.yaml) is the source of truth for flow stru - `flow_input.iter.value` - Current item when inside a for-loop - `flow_input.iter.index` - Current index when inside a for-loop +## Branch Output Rules + +- For `branchone`, downstream steps should consume the branch step's result via `results.branch_step_id` +- Do NOT reference inner branch module ids from outside the branch container, such as `results.branch_step_id.some_inner_step` +- If later steps need a stable fulfillment/result object, make each branch return the same shape and read that from `results.branch_step_id` + +Correct downstream access: +```json +{"fulfillment": {"type": "javascript", "expr": "results.branch_on_inventory"}} +``` + +Incorrect downstream access: +```json +{"fulfillment": {"type": "javascript", "expr": "results.branch_on_inventory.create_shipment || results.branch_on_inventory.create_backorder"}} +``` + ## Input Transforms Every rawscript module needs `input_transforms` to map function parameters to values: diff --git a/system_prompts/base/flow-base.md b/system_prompts/base/flow-base.md index 6c02361891..addb00fd8b 100644 --- a/system_prompts/base/flow-base.md +++ b/system_prompts/base/flow-base.md @@ -40,6 +40,22 @@ The OpenFlow schema (openflow.openapi.yaml) is the source of truth for flow stru - `flow_input.iter.value` - Current item when inside a for-loop - `flow_input.iter.index` - Current index when inside a for-loop +## Branch Output Rules + +- For `branchone`, downstream steps should consume the branch step's result via `results.branch_step_id` +- Do NOT reference inner branch module ids from outside the branch container, such as `results.branch_step_id.some_inner_step` +- If later steps need a stable fulfillment/result object, make each branch return the same shape and read that from `results.branch_step_id` + +Correct downstream access: +```json +{"fulfillment": {"type": "javascript", "expr": "results.branch_on_inventory"}} +``` + +Incorrect downstream access: +```json +{"fulfillment": {"type": "javascript", "expr": "results.branch_on_inventory.create_shipment || results.branch_on_inventory.create_backorder"}} +``` + ## Input Transforms Every rawscript module needs `input_transforms` to map function parameters to values: