Producing Artifacts
Bosun tasks can save the output of any step as an artifact. Artifacts become durable, shareable records: they show up in the run transcript, they populate the project-wide Artifacts library, and they can feed future steps or entirely separate tasks.
What artifacts represent
Artifacts are plain-text or Markdown documents created during a task run. Typical uses include:
- Agent-generated documents such as release notes, QA reports, or migration guides.
- Structured data that needs human review before landing in a repository.
- Large command outputs you want to reference later without rerunning the tooling.
Every artifact carries provenance (session, task run, step) so you can trace it back to the manifest that produced it.
Saving an artifact in a manifest
Add a save_artifact step wherever you want to persist content. The step renders its name and content fields just like any other templated string. When it runs, Bosun stores the artifact and records the identifier under outputs.<step>.artifact_id so later steps can reference it.
steps:
- id: summarize-tests
agent:
extends: Coding
instructions: "Run the regression suite and describe the results."
- name: Save regression summary
save_artifact:
name: "Regression summary {{ task_run.started_at | date(format="%Y-%m-%d") }}"
content: |
# Regression summary
{{ outputs.summarize-tests }}
Wiring artifacts into other steps
Once an artifact exists, there are two primary ways to consume it:
- Directly within the same task: Access the step output via
outputs.<step>.artifact_idand pass that ID into another step or notification. When a later agent needs the actual content, call the Artifacts API or ask the agent to fetch the artifact by ID using a custom tool. - As task inputs: When configuring a run in the UI, click Insert artifact next to any input field. Bosun opens the Artifacts picker, lets you search by name/content, and injects the artifact body into the input so templated steps can reference it. This makes artifacts a lightweight handoff mechanism between separate runs.
Artifacts retain their original Markdown, so agents consuming them later do not lose formatting. Archived artifacts disappear from pickers by default to reduce clutter.
Artifact shape and schemas
Each saved artifact produces a structured step output:
{
"artifact_id": "8e5d7b46-...",
"project_id": "f64b0b90-...",
"name": "Regression summary 2024-02-10"
}
That output lives under outputs.<step> alongside any errors if rendering failed. When you design downstream steps that need more than the ID or name, combine artifacts with Custom Schemas. For example, an agent can emit a JSON object describing regression owners, the next step can transform it into Markdown, and save_artifact can persist the rendered report.
Steps with structured outputs—like the agent step described in Steps in Depth—already demonstrate how to reference outputs and errors. Treat artifacts the same way: their IDs slot into later templates, and the content itself remains accessible via the Artifacts library or API.