Talk with Archie
API reference › Authoring
Skills › Authoring

Draft a New Workstream Conversationally

POST/api/v1/skills/workstream.draft/invoke
Describe the workstream you want in the description input and Archie drafts a structured, reviewable definition with typed steps, dependencies and validation. The reply gives the draft id, name, step count, validation warning count and version, or the one question to answer next. Drafting never activates a workstream; workstream.commit does that.
Body parameters
descriptionstringRequired
Natural-language description of the workstream to draft.
Example Monthly close for SaaS clients with deferred revenue tracking.
topic_idstring
Topic to anchor the draft to — permakey (preferred) or UUID.
prior_draft_idstring · uuid
Optional prior draft to iterate on instead of creating a new one.
namestring
Optional working name; context for the authoring agent, not a constraint.
file_idsarray of strings
Source documents the authoring agent must read completely before drafting.
threadarray of objects
Prior authoring frames/messages for one-question-at-a-time refinement.
draft_keystring
Stable caller identity for this conversational draft.
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 returns the previously-created draft id rather than generating a duplicate.
Returns

Skill executed successfully

skillstringRequired
Example workstream_draft
outputobjectRequired
Visible draft identity or the next single material clarification.
output.stub_fieldsarray of strings
output.warningsarray of strings
output.draft_idstring · uuid
Newly-created draft id.
output.namestring · default
Working name the LLM gave the draft.
output.step_countinteger · default 0
Number of steps the LLM generated.
output.target_execution_modeenum · default inline
Execution mode the draft was generated for.
inlinecontainerized
output.validation_warning_countinteger · default 0
Number of validation warnings on the draft. Non-zero is fine for drafts; commit will reject if any blocking warnings remain.
output.versioninteger
Persisted WorkStream version.
output.statusstring
Explicit lifecycle status; authoring never activates the WorkStream.
output.questionstring
One material clarification to answer on the next turn.
output.framesarray of objects
Visible research, tool, question and proposal 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 draft generation 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.draft/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.draft",
    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.draft", {
  "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_draft",
  "output": {
    "draft_id": "7b2e9c40-5d1a-4f83-9a6e-2c4b8d0e1f57",
    "name": "Northwind month-end close",
    "status": "draft",
    "step_count": 6,
    "target_execution_mode": "inline",
    "validation_warning_count": 0,
    "version": 1
  },
  "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.