Build workflows
Artifacts
Markdown documents that outlive the run that wrote them — reports, logs and briefs your workflows keep up to date, with every version kept.
A step's output lasts as long as its run, and a workspace is deleted the moment the run finishes. Artifacts are for what should stay: a weekly report, a running incident log, a brief a person reads in the morning. Each one is a markdown document that belongs to the account, has a slug such as ops-weekly, and keeps every version it has ever had.
The artifact tools are available to every account with nothing to set up, under the artifact. prefix, in tool steps and in an agent's tools list.
Writing one
steps:
- key: incidents
kind: tool
tool: postgres.query
args: { sql: "select title, severity, resolved_at from incidents where opened_at > now() - interval '7 days'" }
- key: report
kind: llm
prompt: |
Write this week's operations report in markdown, with a section per severity.
{{ steps.incidents.output }}
- key: save
kind: tool
tool: artifact.write
args: { slug: ops-weekly, title: Operations weekly, body: "{{ steps.report.output.text }}" }
write replaces the whole document and creates it if the slug is new. The next run writes the same slug again, and the old report is still there in the artifact's history.
Changing part of one
Rewriting a long document to change one line wastes tokens and invites mistakes, so the tools can also work on a part:
appendadds markdown to the end, or to the end of one section. A list item appended under a list stays part of that list.edit_sectionreplaces what is under one heading, up to the next heading of the same or a higher level, and leaves the rest alone.readwithsectionreturns only that section, and always lists the document's headings.
A section named in append or edit_section that does not exist yet is added at the end.
- key: log
kind: tool
tool: artifact.append
args:
slug: deploy-log
section: "{{ trigger.repository.name }}"
content: "- {{ trigger.head_commit.id }} deployed by {{ trigger.pusher.name }}"
Charts
A fenced block whose language is chart is drawn as a chart, with uPlot, when the artifact is shown. The block is a few lines of YAML, and it lives in the document like everything else, so it is versioned with it and a workflow reads and writes it as plain text.
The data is either rows in the block itself:
```chart
type: bar
title: Deploys per service
x: Service
series: [Deploys, Rollbacks]
data:
- [api, 14, 1]
- [web, 9, 0]
```
or the first table under a heading, which is how to keep a chart that grows. Write the block and the table's header once, and each run appends one row under the heading:
```chart
type: line
title: Signups per week
table: Signups
```
## Signups
| Week | Signups | Churned |
|---|---|---|
| 2026-10-05 | 42 | 3 |
- key: chart
kind: tool
tool: artifact.append
args: { slug: growth, section: Signups, content: "| {{ steps.count.output.week }} | {{ steps.count.output.signups }} | {{ steps.count.output.churned }} |" }
| key | meaning |
|---|---|
type |
line (the default), bar or area |
title |
A caption above the chart |
data |
Rows, each [x, value, value, ...], with series naming the values |
series |
With table, the columns to draw; every column of numbers but x when left out |
table |
The heading whose first table holds the data |
x, y |
Axis labels. With table, x names the column to use as x, the first when left out. |
x values that are all dates make a time axis, numbers a numeric one, and anything else one category per row in the order written. Values can be written as people write them, 1,234, $5 or 12%, and an empty cell or - is a gap in the line. A save whose chart can't be drawn is refused with the reason, so a workflow hears about a broken chart when it writes it rather than when someone opens the page.
Reading one in a template
Any step can read an artifact through a template, with no tool call: {{ artifacts.<slug>.body }}, and also .title, .version, .url and .updated_at.
steps:
- key: brief
kind: llm
prompt: |
Here is the brief as it stands. Rewrite the Today section for {{ trigger.scheduled_at }}.
{{ artifacts.morning-brief.body }}
- key: post
kind: tool
tool: slack.post_message
args: { channel: C0123, text: "Brief updated: {{ artifacts.morning-brief.url }}" }
A step reads the artifact as it is when the step starts, and loads only the artifacts it names. An artifact that doesn't exist resolves to nothing, so a condition can check for it:
if: '!("morning-brief" in artifacts)'
Steps that write an artifact aren't linked automatically to steps that read it through a template. When one step of a run writes an artifact and a later step reads it, add the writer to the reader's depends_on.
From a workspace
When a coding agent or a script writes the document, artifact.import copies a text file out of the run's workspace into an artifact as its new body.
History and retries
Every change is a new version, recorded with the run and step that made it. The Artifacts page shows each document rendered, its history, and the diff between any version and the one before.
A step that is retried after an interruption does not apply its change twice: repeating the same call from the same step is recognised, and the version it already saved is returned.
Over MCP
Your own agents can use the same tools over MCP as artifact__list, artifact__read, artifact__write, artifact__append and artifact__edit_section. Changes made this way are recorded against the person the token belongs to.