Topolo Docs Topolo Platform
Open workspace

Draft sequence steps with AI

Draft 1 to 10 plain-text cold outreach email steps through the Topolo Nexus AI gateway as the signed-in person (spends organization AI budget). The model may use only the brief and the facts given (up to 20); it is told never to invent claims, numbers, customers, offers or links, to use only Engage merge fields, and to leave out unsubscribe wording (the compliance footer owns opt-out). Returns {steps:[{subject, body, delayDays}], report} where report is the sequences.copy_check result for the draft. Nothing is saved: review the steps, then save them with sequences.versions.steps.set. Errors: 401 unauthenticated without a user bearer, 409 ai_unavailable when this deploy has no Nexus gateway, 403 ai_access_denied when Nexus refuses the person, 409 ai_not_enabled when Nexus does not enable AI for Engage in the organization, 502 draft_unavailable for any other gateway failure or an unusable draft.

Outcome

Draft 1 to 10 plain-text cold outreach email steps through the Topolo Nexus AI gateway as the signed-in person (spends organization AI budget). The model may use only the brief and the facts given (up to 20); it is told never to invent claims, numbers, customers, offers or links, to use only Engage merge fields, and to leave out unsubscribe wording (the compliance footer owns opt-out). Returns {steps:[{subject, body, delayDays}], report} where report is the sequences.copy_check result for the draft. Nothing is saved: review the steps, then save them with sequences.versions.steps.set. Errors: 401 unauthenticated without a user bearer, 409 ai_unavailable when this deploy has no Nexus gateway, 403 ai_access_denied when Nexus refuses the person, 409 ai_not_enabled when Nexus does not enable AI for Engage in the organization, 502 draft_unavailable for any other gateway failure or an unusable draft.

Before you start

  • Verify the intended environment, signed-in credential, authorized organization and the action permission workspace:write.
  • Discover and select an authorized canonical Engage workspace. Pass resourceType=workspace and resourceId separately from action input.
  • Review the exact effects and obtain approval before CLI --confirm or MCP confirm:true. A local capture does not authorize a live mutation.

Discover the target

topolo whoami --json
topolo actions get app_topolo_engage.sequences.draft_steps --json
topolo workspaces list topolo-engage --json

Set ENGAGE_WORKSPACE_ID to the identifier of the selected authorized workspace.

Input contract

FieldRequiredDeclared constraints
briefYes{"type":"string","minLength":1,"maxLength":2000}
factsNo{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}}
stepsYes{"type":"integer","minimum":1,"maximum":10}
toneNo{"type":"string","enum":["plain","warm","direct"]}
includeTaskStepsNo{"type":"boolean","const":false}

Validate, plan and execute

Build payload.json from the current schema and discovered identifiers. The action description above defines its behavior, limits, side effects and declared errors.

: "${ENGAGE_WORKSPACE_ID:?Set ENGAGE_WORKSPACE_ID to your selected workspace identifier}"
topolo actions validate app_topolo_engage.sequences.draft_steps --data @payload.json --json
topolo actions plan app_topolo_engage.sequences.draft_steps --resource-type workspace --resource-id "$ENGAGE_WORKSPACE_ID" --data @payload.json --confirm --json

Review the plan and approve its exact effects before executing the unchanged request.

: "${ENGAGE_WORKSPACE_ID:?Set ENGAGE_WORKSPACE_ID to your selected workspace identifier}"
topolo actions call app_topolo_engage.sequences.draft_steps --resource-type workspace --resource-id "$ENGAGE_WORKSPACE_ID" --data @payload.json --confirm --json

For MCP, use topolo_get_action, topolo_validate_action, topolo_plan_action and topolo_call_action. Pass resource context separately where required; confirm:true is required for mutations.

Captured successful requests and responses

Captured HTTP 200 · sequences.draft_steps > drafts through the drafter as the person, attaches copy QA, saves nothing and audits no content

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "steps": [
    {
      "subject": "Data entry at {{company}}",
      "body": "Hi {{first_name}}, word0 word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12 word13 word14 word15 word16 word17 word18 word19 word20 word21 word22 word23 word24 word25 word26 word27 word28 word29\n\n{{sender_name}}",
      "delayDays": 0
    },
    {
      "subject": "Following up",
      "body": "Hi {{first_name}}, word0 word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12 word13 word14 word15 word16 word17 word18 word19 word20 word21 word22 word23 word24 word25 word26 word27 word28 word29 TODO",
      "delayDays": 4
    }
  ],
  "report": {
    "pass": false,
    "errorCount": 1,
    "warningCount": 3,
    "steps": [
      {
        "position": 1,
        "findings": [
          {
            "code": "merge_field_without_fallback",
            "severity": "warning",
            "message": "{{company}} is optional contact data and has no fallback: contacts without it stop instead of receiving this step.",
            "location": {
              "field": "subject",
              "match": "{{company}}"
            }
          },
          {
            "code": "merge_field_without_fallback",
            "severity": "warning",
            "message": "{{first_name}} is optional contact data and has no fallback: contacts without it stop instead of receiving this step.",
            "location": {
              "field": "body",
              "match": "{{first_name}}"
            }
          }
        ]
      },
      {
        "position": 2,
        "findings": [
          {
            "code": "merge_field_without_fallback",
            "severity": "warning",
            "message": "{{first_name}} is optional contact data and has no fallback: contacts without it stop instead of receiving this step.",
            "location": {
              "field": "body",
              "match": "{{first_name}}"
            }
          },
          {
            "code": "placeholder_text",
            "severity": "error",
            "message": "Placeholder text \"TODO\" is still in the copy.",
            "location": {
              "field": "body",
              "match": "TODO"
            }
          }
        ]
      }
    ]
  }
}

Source test: sequences.draft_steps > drafts through the drafter as the person, attaches copy QA, saves nothing and audits no content. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 200 · sequences.draft_steps > defaults to no facts and a plain tone

Action input

{
  "brief": "x",
  "steps": 1
}

Actual local response

{
  "steps": [
    {
      "subject": "s",
      "body": "b",
      "delayDays": 0
    }
  ],
  "report": {
    "pass": true,
    "errorCount": 0,
    "warningCount": 2,
    "steps": [
      {
        "position": 1,
        "findings": [
          {
            "code": "body_too_short",
            "severity": "warning",
            "message": "1 words; cold outreach under 25 words often lacks context.",
            "location": {
              "field": "body"
            }
          },
          {
            "code": "first_step_not_personalized",
            "severity": "warning",
            "message": "The first email uses none of {{first_name}}, {{last_name}}, {{company}}, {{title}}.",
            "location": {
              "field": "body"
            }
          }
        ]
      }
    ]
  }
}

Source test: sequences.draft_steps > defaults to no facts and a plain tone. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 200 · sequences.draft_steps > refuses callers without workspace:write and invalid input

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct",
  "includeTaskSteps": false
}

Actual local response

{
  "steps": [
    {
      "subject": "Data entry at {{company}}",
      "body": "Hi {{first_name}}, word0 word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12 word13 word14 word15 word16 word17 word18 word19 word20 word21 word22 word23 word24 word25 word26 word27 word28 word29\n\n{{sender_name}}",
      "delayDays": 0
    },
    {
      "subject": "Following up",
      "body": "Hi {{first_name}}, word0 word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12 word13 word14 word15 word16 word17 word18 word19 word20 word21 word22 word23 word24 word25 word26 word27 word28 word29 TODO",
      "delayDays": 4
    }
  ],
  "report": {
    "pass": false,
    "errorCount": 1,
    "warningCount": 3,
    "steps": [
      {
        "position": 1,
        "findings": [
          {
            "code": "merge_field_without_fallback",
            "severity": "warning",
            "message": "{{company}} is optional contact data and has no fallback: contacts without it stop instead of receiving this step.",
            "location": {
              "field": "subject",
              "match": "{{company}}"
            }
          },
          {
            "code": "merge_field_without_fallback",
            "severity": "warning",
            "message": "{{first_name}} is optional contact data and has no fallback: contacts without it stop instead of receiving this step.",
            "location": {
              "field": "body",
              "match": "{{first_name}}"
            }
          }
        ]
      },
      {
        "position": 2,
        "findings": [
          {
            "code": "merge_field_without_fallback",
            "severity": "warning",
            "message": "{{first_name}} is optional contact data and has no fallback: contacts without it stop instead of receiving this step.",
            "location": {
              "field": "body",
              "match": "{{first_name}}"
            }
          },
          {
            "code": "placeholder_text",
            "severity": "error",
            "message": "Placeholder text \"TODO\" is still in the copy.",
            "location": {
              "field": "body",
              "match": "TODO"
            }
          }
        ]
      }
    ]
  }
}

Source test: sequences.draft_steps > refuses callers without workspace:write and invalid input. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Effects and response meaning

  • Draft 1 to 10 plain-text cold outreach email steps through the Topolo Nexus AI gateway as the signed-in person (spends organization AI budget). The model may use only the brief and the facts given (up to 20); it is told never to invent claims, numbers, customers, offers or links, to use only Engage merge fields, and to leave out unsubscribe wording (the compliance footer owns opt-out). Returns {steps:[{subject, body, delayDays}], report} where report is the sequences.copy_check result for the draft. Nothing is saved: review the steps, then save them with sequences.versions.steps.set. Errors: 401 unauthenticated without a user bearer, 409 ai_unavailable when this deploy has no Nexus gateway, 403 ai_access_denied when Nexus refuses the person, 409 ai_not_enabled when Nexus does not enable AI for Engage in the organization, 502 draft_unavailable for any other gateway failure or an unusable draft.

Verify the outcome

  • Check the response against the declared output schema and the requested operation. For mutations, use the action-specific read described in the action description before any dependent operation.

Recover

For an uncertain result, inspect current retained state with a read action before retrying. Do not replay a mutation unless its contract explicitly guarantees idempotency.

Refused requests

Captured HTTP 403 · sequences.draft_steps > refuses callers without workspace:write and invalid input

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "permission_denied",
    "message": "The credential lacks workspace:write.",
    "details": {
      "requiredPermission": "workspace:write"
    }
  }
}

Source test: sequences.draft_steps > refuses callers without workspace:write and invalid input. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 422 · sequences.draft_steps > refuses callers without workspace:write and invalid input

Refused input; do not execute

{
  "brief": "",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "invalid_action_input",
    "message": "Input for sequences.draft_steps is invalid.",
    "details": [
      {
        "origin": "string",
        "code": "too_small",
        "minimum": 1,
        "inclusive": true,
        "path": [
          "brief"
        ],
        "message": "Too small: expected string to have >=1 characters"
      }
    ]
  }
}

Source test: sequences.draft_steps > refuses callers without workspace:write and invalid input. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 401 · sequences.draft_steps > needs the person's bearer and a configured gateway

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "unauthenticated",
    "message": "Drafting runs as the signed-in person; sign in again."
  }
}

Source test: sequences.draft_steps > needs the person's bearer and a configured gateway. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 409 · sequences.draft_steps > needs the person's bearer and a configured gateway

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "ai_unavailable",
    "message": "AI drafting is not available in this environment."
  }
}

Source test: sequences.draft_steps > needs the person's bearer and a configured gateway. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 403 · sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "ai_access_denied",
    "message": "Your organization has not allowed you to use AI drafting."
  }
}

Source test: sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 409 · sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "ai_not_enabled",
    "message": "AI drafting is not enabled for Engage in this organization yet. Write the steps yourself for now."
  }
}

Source test: sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 502 · sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "draft_unavailable",
    "message": "The AI draft could not be produced (empty_completion). Try again, or write the steps yourself.",
    "details": {
      "upstreamStatus": 400,
      "upstreamCode": "empty_completion"
    }
  }
}

Source test: sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 422 · sequences.draft_steps > refuses callers without workspace:write and invalid input

Refused input; do not execute

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 0,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "invalid_action_input",
    "message": "Input for sequences.draft_steps is invalid.",
    "details": [
      {
        "origin": "number",
        "code": "too_small",
        "minimum": 1,
        "inclusive": true,
        "path": [
          "steps"
        ],
        "message": "Too small: expected number to be >=1"
      }
    ]
  }
}

Source test: sequences.draft_steps > refuses callers without workspace:write and invalid input. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 422 · sequences.draft_steps > refuses callers without workspace:write and invalid input

Refused input; do not execute

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 11,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "invalid_action_input",
    "message": "Input for sequences.draft_steps is invalid.",
    "details": [
      {
        "origin": "number",
        "code": "too_big",
        "maximum": 10,
        "inclusive": true,
        "path": [
          "steps"
        ],
        "message": "Too big: expected number to be <=10"
      }
    ]
  }
}

Source test: sequences.draft_steps > refuses callers without workspace:write and invalid input. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 422 · sequences.draft_steps > refuses callers without workspace:write and invalid input

Refused input; do not execute

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "pushy"
}

Actual local response

{
  "error": {
    "code": "invalid_action_input",
    "message": "Input for sequences.draft_steps is invalid.",
    "details": [
      {
        "code": "invalid_value",
        "values": [
          "plain",
          "warm",
          "direct"
        ],
        "path": [
          "tone"
        ],
        "message": "Invalid option: expected one of \"plain\"|\"warm\"|\"direct\""
      }
    ]
  }
}

Source test: sequences.draft_steps > refuses callers without workspace:write and invalid input. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 422 · sequences.draft_steps > refuses callers without workspace:write and invalid input

Refused input; do not execute

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct",
  "includeTaskSteps": true
}

Actual local response

{
  "error": {
    "code": "invalid_action_input",
    "message": "Input for sequences.draft_steps is invalid.",
    "details": [
      {
        "code": "invalid_value",
        "values": [
          false
        ],
        "path": [
          "includeTaskSteps"
        ],
        "message": "Invalid input: expected false"
      }
    ]
  }
}

Source test: sequences.draft_steps > refuses callers without workspace:write and invalid input. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 422 · sequences.draft_steps > refuses callers without workspace:write and invalid input

Refused input; do not execute

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f",
    "f"
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "invalid_action_input",
    "message": "Input for sequences.draft_steps is invalid.",
    "details": [
      {
        "origin": "array",
        "code": "too_big",
        "maximum": 20,
        "inclusive": true,
        "path": [
          "facts"
        ],
        "message": "Too big: expected array to have <=20 items"
      }
    ]
  }
}

Source test: sequences.draft_steps > refuses callers without workspace:write and invalid input. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 422 · sequences.draft_steps > refuses callers without workspace:write and invalid input

Refused input; do not execute

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "invalid_action_input",
    "message": "Input for sequences.draft_steps is invalid.",
    "details": [
      {
        "origin": "string",
        "code": "too_big",
        "maximum": 300,
        "inclusive": true,
        "path": [
          "facts",
          0
        ],
        "message": "Too big: expected string to have <=300 characters"
      }
    ]
  }
}

Source test: sequences.draft_steps > refuses callers without workspace:write and invalid input. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 422 · sequences.draft_steps > refuses callers without workspace:write and invalid input

Refused input; do not execute

{
  "brief": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "invalid_action_input",
    "message": "Input for sequences.draft_steps is invalid.",
    "details": [
      {
        "origin": "string",
        "code": "too_big",
        "maximum": 2000,
        "inclusive": true,
        "path": [
          "brief"
        ],
        "message": "Too big: expected string to have <=2000 characters"
      }
    ]
  }
}

Source test: sequences.draft_steps > refuses callers without workspace:write and invalid input. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 422 · sequences.draft_steps > refuses callers without workspace:write and invalid input

Refused input; do not execute

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct",
  "other": 1
}

Actual local response

{
  "error": {
    "code": "invalid_action_input",
    "message": "Input for sequences.draft_steps is invalid.",
    "details": [
      {
        "code": "unrecognized_keys",
        "keys": [
          "other"
        ],
        "path": [],
        "message": "Unrecognized key: \"other\""
      }
    ]
  }
}

Source test: sequences.draft_steps > refuses callers without workspace:write and invalid input. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 502 · sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "draft_unavailable",
    "message": "The AI draft could not be produced (empty_completion). Try again, or write the steps yourself.",
    "details": {
      "upstreamStatus": 429,
      "upstreamCode": "empty_completion"
    }
  }
}

Source test: sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 502 · sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "draft_unavailable",
    "message": "The AI draft could not be produced (empty_completion). Try again, or write the steps yourself.",
    "details": {
      "upstreamStatus": 500,
      "upstreamCode": "empty_completion"
    }
  }
}

Source test: sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 502 · sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "draft_unavailable",
    "message": "The AI draft could not be produced (empty_completion). Try again, or write the steps yourself.",
    "details": {
      "upstreamStatus": 502,
      "upstreamCode": "empty_completion"
    }
  }
}

Source test: sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 502 · sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "draft_unavailable",
    "message": "The AI draft could not be produced (unparsable). Try again, or write the steps yourself.",
    "details": {
      "reason": "unparsable"
    }
  }
}

Source test: sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Captured HTTP 502 · sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing

Action input

{
  "brief": "Ops leads at logistics firms; we cut manual data entry.",
  "facts": [
    "We integrate with SAP."
  ],
  "steps": 2,
  "tone": "direct"
}

Actual local response

{
  "error": {
    "code": "draft_unavailable",
    "message": "The AI draft could not be produced (http_401). Try again, or write the steps yourself.",
    "details": {
      "upstreamStatus": 401,
      "upstreamCode": null
    }
  }
}

Source test: sequences.draft_steps > maps gateway errors and unusable drafts, auditing nothing. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

Error recovery

  • HTTP 403 permission_denied: Stop and inspect the current credential and selected resource. It needs workspace:write; do not broaden access or switch organization automatically.
  • HTTP 422 invalid_action_input: Correct the request against the current action input schema, then validate it again before planning.
  • HTTP 401 unauthenticated: Read the refusal details and current action contract, correct the stated cause, then validate and plan again. Do not retry unchanged or infer success.
  • HTTP 409 ai_unavailable: Preserve the request and inspect the declared dependency state. Retry only after the transient or configuration cause is resolved; do not infer that the operation completed.
  • HTTP 403 ai_access_denied: Read the refusal details and current action contract, correct the stated cause, then validate and plan again. Do not retry unchanged or infer success.
  • HTTP 409 ai_not_enabled: Read the refusal details and current action contract, correct the stated cause, then validate and plan again. Do not retry unchanged or infer success.
  • HTTP 502 draft_unavailable: Preserve the request and inspect the declared dependency state. Retry only after the transient or configuration cause is resolved; do not infer that the operation completed.

Evidence and limits

  • /api/sequences/draft-steps

  • Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.

  • Widget/bootstrap use actual app handler but mocked worker runtime and app identity.

  • No gateway execution, live permissions, external delivery or deployed proof.

These are local route captures with synthetic identity and simulated dependencies. They do not prove live authorization, gateway execution, production state, or external delivery.