Talk with Archie
API reference › Authoring
Skills › Authoring

Specify a WorkStream Before Drafting Its Steps

POST/api/v1/skills/workstream.design/invoke
Starts the design interview for a workstream from the description input and returns its spec: each decision with its question, the builder's proposal, its reason, its citation and its status, plus the spec_hash and the next question to answer. The spec is stored so workstream.spec can read it back and workstream.spec.answer can settle open decisions. It creates no steps and no workstream.
Body parameters
descriptionstringRequired
Natural-language description of the workstream to specify.
Example Monthly close for SaaS clients with deferred revenue tracking.
topic_idstring
Topic to anchor the design interview to — permakey (preferred) or UUID.
prior_draft_idstring · uuid
Optional prior draft to iterate on instead of starting a new interview.
namestring
Optional working name; context for the authoring agent, not a constraint.
file_idsarray of strings
Source documents the questions come from. With none, the tool says it has nothing to read rather than asking generic shape questions.
threadarray of objects
Prior authoring frames/messages for one-question-at-a-time refinement.
draft_keystring
Stable caller identity for this conversational interview.
target_execution_modeenum · default inline
Canonical authoring creates inline WorkStreams. The legacy containerized authoring destination is refused; bounded agentic work uses agent_run steps.
inlinecontainerized
idempotency_keystring
Caller-supplied stable token. Replaying within 24h resumes the same interview rather than starting a duplicate.
Returns

Skill executed successfully

skillstringRequired
Example workstream_design
outputobjectRequired
The interview's spec: decisions with question/proposal/reason/citation/status.

Design stops BEFORE the proposal: no step list, no draft id. The decisions persist to the spec store so workstream_spec can read them back and workstream_spec_answer can answer one open decision.

output.stub_fieldsarray of strings
output.warningsarray of strings
output.decisionsarray of objects
The spec's decisions — each with its question, the builder's proposal, its reason, its citation, and its status (open/answered).
output.spec_hashstring
Content address of the persisted spec; changes when an answer changes.
output.questionstring
One material clarification to answer on the next turn.
output.framesarray of objects
Visible research, tool, and question transcript for this turn.
output.authoring_provenanceobject
Logical role, exact provider/model and content-addressed contract version.
output.errorstringDeprecated
output.error_envelope
Canonical structured error. Populated on interview failure.
correlation_idstringRequired
Errors
StatusTypeWhen
401AUTH.TOKEN_INVALIDAuthentication required
403PERMISSION.CAPABILITY_DENIEDInsufficient permissions
404SKILL.NOT_FOUNDSkill not found
422VALIDATION.INVALID_FORMATValidation error
429RATE_LIMIT.USERRate limit exceeded
5XXINTERNAL.UNKNOWNInternal server error
curl https://uk.heyarchie.com/api/v1/skills/workstream.design/invoke \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{
       "description": "Monthly close for SaaS clients with deferred revenue tracking.",
       "topic_id": null,
       "prior_draft_id": null,
       "name": null,
       "file_ids": [
         "00000000-0000-0000-0000-000000000000"
       ],
       "thread": [
         {}
       ],
       "draft_key": null,
       "target_execution_mode": "inline",
       "idempotency_key": null
     }'
from heyarchie import Archie
archie = Archie(api_key="sk_...")
result = archie.skills.invoke(
    "workstream.design",
    description="Monthly close for SaaS clients with deferred revenue tracking.",
    topic_id=None,
    prior_draft_id=None,
    name=None,
    file_ids=["00000000-0000-0000-0000-000000000000"],
    thread=[{}],
    draft_key=None,
    target_execution_mode="inline",
    idempotency_key=None,
)
print(result)
import { Archie } from "heyarchie";

const archie = new Archie({ apiKey: "sk_..." });
const result = await archie.skills.invoke("workstream.design", {
  "description": "Monthly close for SaaS clients with deferred revenue tracking.",
  "topic_id": null,
  "prior_draft_id": null,
  "name": null,
  "file_ids": [
    "00000000-0000-0000-0000-000000000000"
  ],
  "thread": [
    {}
  ],
  "draft_key": null,
  "target_execution_mode": "inline",
  "idempotency_key": null
});
console.log(result);
Response
{
  "skill": "workstream_design",
  "output": {
    "decisions": [
      {
        "document_id": "3e8a1d65-92b7-4c0f-a4d9-6b1f0c7e2a83",
        "id": "close-deadline",
        "options": [
          {
            "id": "o1",
            "label": "Working day 5",
            "value": "wd5"
          },
          {
            "id": "o2",
            "label": "Working day 8",
            "value": "wd8"
          }
        ],
        "page": 2,
        "proposal": "wd5",
        "question": "By which working day must the close be finished?",
        "reason": "The close checklist sets the client pack deadline at working day 5.",
        "status": "open"
      }
    ],
    "question": "By which working day must the close be finished?",
    "spec_hash": "9b1e4c7a02d35f68"
  },
  "correlation_id": "<string>"
}
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}

Every response also carries X-Request-ID. Quote it if you write to us about a call.