Plan a Campaign with Work
A Work is Gavana’s chat-first planning object for a broad social-campaign request — “a spring launch campaign for our travel bottle on Instagram”. Preparing one infers a brief, lays out exactly three directions on a canvas, and recommends one. Nothing paid happens until the user picks a direction and you execute it with an explicit confirmation.
Use Work when the user wants options before committing. For one specific image, use image generation instead; a request with no social-campaign deliverable is refused by Work.
Scopes. Prepare: canvas:read, canvas:write, asset:read. Read: canvas:read. Continue: canvas:read, canvas:write. Refresh: canvas:read, canvas:write, image:generate. Execute: canvas:read, canvas:write, asset:read, image:generate.
Cost. Preparing, answering, adjusting, and choosing cost nothing. Executing is paid.
Call sequence
work prepare → (work continue: answer / adjust) → work continue: select_direction
→ [approval] → work execute --confirm → work get / work refresh → report handlesIn MCP: work_prepare → work_continue → work_execute → work_get or work_refresh. On the hosted server these tools are callable by name but not in the default tool listing; a connection with the advanced profile lists them. The local MCP server lists them.
Steps
Gather durable references
Work takes references only as durable node: or asset: handles — up to 12, and never URLs. Upload a local product photo first, or use an image already on the task canvas:
gavana asset upload ./bottle.png --jq '.asset.handle' -rIf the work should land on an existing canvas, have its handle ready. Otherwise Gavana creates a canvas for this Work.
Prepare the Work
gavana work prepare \
--request "A spring launch campaign for our travel bottle on Instagram" \
--reference asset:PRODUCT_ASSET \
--canvas canvas:OWNER_UID:CANVAS_ID \
--idempotency-key spring-launch-work-001Use your own stable key of 8–200 characters. Re-running the identical request with the same key returns the same Work with replayed: true. To give a reference a role — identity, style, or product — pass the request as --json with { "handle": "asset:…", "role": "product" } entries.
Check. Read status and the Work:
work.directions— exactly three, each with ahandle(direction:…), aname, asummary, and its creative intent: core idea, camera, composition, lighting, motion and texture, copy hierarchy.work.recommendation— the recommended direction and the reason.work.brief.questionsandstatus: needs_input— Gavana needs an answer before it can go further.work.cost.estimated— the estimated number of image generations execution will start.canvas— the handle and a link the user can open to see the directions laid out.
Answer or adjust, if needed
gavana work continue work:WORK_ID --action answer \
--answer "Instagram feed and Stories only" \
--idempotency-key spring-launch-answer-001
gavana work continue work:WORK_ID --action adjust \
--adjustment "Keep the palette pastel and avoid beach imagery" \
--idempotency-key spring-launch-adjust-001Each continuation is its own write with its own key, up to 2,000 characters of text. None of them starts generation.
Let the user choose
Show the user the three directions — by name and summary, with the canvas link — and the recommendation. Then record the choice they made:
gavana work continue work:WORK_ID --action select_direction \
--direction-id direction:DIRECTION_ID \
--idempotency-key spring-launch-pick-001Do not select on the user’s behalf because one direction is recommended. The recommendation is advice for the user, not a decision.
Get explicit approval
State plainly: which direction, which canvas, roughly how many image generations (work.cost.estimated), and that it uses the connected AI provider. Then wait for a yes in the same turn.
Execute once
gavana work execute work:WORK_ID --confirm --idempotency-key spring-launch-run-001Without --confirm the CLI refuses with work execute starts paid work. Re-run with --confirm. Execution starts only the selected direction, refuses a Work with no selection, and returns durable progress immediately — it does not wait, and it never retries paid work on its own. The CLI exits 9 if execution comes back failed, partially_failed, or canceled.
Observe progress
gavana work get work:WORK_ID --jq '.progress'
gavana work refresh work:WORK_IDwork get is a read-only snapshot: it never polls the provider and never writes. work refresh asks Gavana to reconcile provider progress and may write progress and finished outputs to the Work and the canvas; only the Work’s owner may refresh (permissions.canRefresh).
If someone edited the canvas meanwhile, canvasSync.status reads stale or blocked and names the affected outputs. Gavana reports that rather than overwriting the person’s edit. Acknowledge the current canvas explicitly when you mean to continue from it:
gavana work continue work:WORK_ID --rebase --idempotency-key spring-launch-ack-001Report durable handles
Each entry in work.runs carries its outputs: a nodeHandle, an assetHandle once the image exists, and a per-output status. Report the node: and asset: handles and the canvas link. On a failed output, report its error and retryable flag and hand the decision back to the user.
What you end up with
- A
work:handle whose brief, three directions, decision, and runs stay readable - A canvas holding the directions and the generated outputs
- Durable
node:andasset:handles for each finished output
Common mistakes
| Mistake | What happens |
|---|---|
| Passing an image URL as a reference | Refused. Upload it, or import it onto the canvas, and pass the handle |
| A request that is not a social campaign | Refused. Use image generation for a single picture |
| Selecting the recommended direction without asking | Off contract. The choice is the user’s |
work execute without --confirm | Usage error before anything is sent |
| Re-running a failed execution automatically | A second charge for one intent. Report and ask |
Calling work refresh in a tight loop | Every refresh asks the provider. Use work get to read, and refresh when the user wants an update |
Ignoring canvasSync: stale | Outputs may no longer match what a person changed. Read the canvas, then acknowledge with --rebase |