# Draft a New Workstream Conversationally

> Describe the workstream you want in the description input and Archie drafts a structured, reviewable definition with typed steps, dependencies and…

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

description string Required

Natural-language description of the workstream to draft.

Example Monthly close for SaaS clients with deferred revenue tracking.

topic_id string

Topic to anchor the draft to — permakey (preferred) or UUID.

prior_draft_id string · uuid

Optional prior draft to iterate on instead of creating a new one.

name string

Optional working name; context for the authoring agent, not a constraint.

file_ids array of strings

Source documents the authoring agent must read completely before drafting.

thread array of objects

Prior authoring frames/messages for one-question-at-a-time refinement.

draft_key string

Stable caller identity for this conversational draft.

target_execution_mode enum · default inline

Canonical authoring creates inline WorkStreams. The legacy containerized authoring destination is refused; bounded agentic work uses agent_run steps.

inline containerized

idempotency_key string

Caller-supplied stable token. Replaying within 24h returns the previously-created draft id rather than generating a duplicate.

Returns

Skill executed successfully

skill string Required

Example workstream_draft

output object Required

Visible draft identity or the next single material clarification.

output.stub_fields array of strings

output.warnings array of strings

output.draft_id string · uuid

Newly-created draft id.

output.name string · default

Working name the LLM gave the draft.

output.step_count integer · default 0

Number of steps the LLM generated.

output.target_execution_mode enum · default inline

Execution mode the draft was generated for.

inline containerized

output.validation_warning_count integer · default 0

Number of validation warnings on the draft. Non-zero is fine for drafts; commit will reject if any blocking warnings remain.

output.version integer

Persisted WorkStream version.

output.status string

Explicit lifecycle status; authoring never activates the WorkStream.

output.question string

One material clarification to answer on the next turn.

output.frames array of objects

Visible research, tool, question and proposal transcript for this turn.

output.authoring_provenance object

Logical role, exact provider/model and content-addressed contract version.

output.error string Deprecated

output.error_envelope

Canonical structured error. Populated on draft generation failure.

correlation_id string Required

Errors

Status Type When

401 AUTH.TOKEN_INVALID Authentication required

403 PERMISSION.CAPABILITY_DENIED Insufficient permissions

404 SKILL.NOT_FOUND Skill not found

422 VALIDATION.INVALID_FORMAT Validation error

429 RATE_LIMIT.USER Rate limit exceeded

5XX INTERNAL.UNKNOWN Internal server error

[Previous ← Specify a WorkStream Before Drafting Its Steps](https://heyarchie.com/en-gb/developers/api-reference/authoring/specify-a-workstream-before-drafting-its-steps/)[Next Answer One Open Decision on a WorkStream Spec →](https://heyarchie.com/en-gb/developers/api-reference/authoring/answer-one-open-decision-on-a-workstream-spec/)

```
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>"
  }
}
```

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