Blueprints: save a pattern, run it with different inputs
A blueprint is a reusable template for work Cadreen does. You create one from a successful trace or from scratch, then run it whenever you need the same type of work done with different data.
What is a blueprint?
A blueprint captures the pattern of a successful piece of work — the intent, the plan, the tools it uses, the policies it respects — so you can repeat it with different inputs.
A blueprint is not a replay — it's a template that runs with different data each time
Create a blueprint from a trace
The easiest way to create a blueprint: find a trace where Cadreen did exactly what you wanted, and save it as a reusable template.
1. Go to /infra/dashboard/traces
2. Find the trace you want to repeat
3. Click "Save as workflow"
4. Give it a name — doneconst blueprint = await cadreen.blueprints.create({
name: "Process refund for order",
description: "Validates refund eligibility, processes via Stripe, notifies customer",
source: { type: "trace", trace_id: "tr_abc123" },
});cadreen blueprints create --name "Process refund" --from-trace tr_abc123Create a blueprint from scratch
You can also create a blueprint manually. Define the name, description, and optional parameter schema — Cadreen builds the plan when you run it.
const blueprint = await cadreen.blueprints.create({
name: "Daily analytics report",
description: "Generate and email the daily analytics dashboard",
parameter_schema: {
type: "object",
properties: {
date: { type: "string", format: "date", description: "Report date" },
recipients: { type: "array", items: { type: "string" }, description: "Email addresses" },
},
required: ["date"],
},
});curl -X POST https://accomplishanything.today/api/v1/cadreen/blueprints \
-H "Authorization: Bearer sk_cadreen_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Daily analytics report",
"description": "Generate and email the daily analytics dashboard",
"parameter_schema": {
"type": "object",
"properties": {
"date": { "type": "string", "format": "date" }
}
}
}'Run a blueprint
Running a blueprint creates a new execution. You pass parameters — the blueprint provides defaults for anything you omit.
1. Go to /infra/dashboard/blueprints
2. Find the blueprint you want to run
3. Click the play button
4. Fill in parameters (or use defaults)
5. Run — see results in real timeconst run = await cadreen.blueprints.run("bp_01JX", {
params: { date: "2026-06-22", recipients: ["team@example.com"] },
});
console.log(run.status); // "queued" → "started" → "succeeded"cadreen blueprints run bp_01JX --param date=2026-06-22curl -X POST https://accomplishanything.today/api/v1/cadreen/blueprints/bp_01JX/runs \
-H "Authorization: Bearer sk_cadreen_..." \
-H "Content-Type: application/json" \
-d '{ "params": { "date": "2026-06-22" } }'Automate with schedules
Attach a schedule to a blueprint and it runs automatically — daily, weekly, or on a cron expression. No custom scheduler needed.
const schedule = await cadreen.schedules.create({
blueprint_id: "bp_01JX",
trigger: {
type: "cron",
expression: "0 9 * * 1-5", // Weekdays at 9am
timezone: "America/New_York",
},
params: { recipients: ["team@example.com"] },
});curl -X POST https://accomplishanything.today/api/v1/cadreen/schedules \
-H "Authorization: Bearer sk_cadreen_..." \
-H "Content-Type: application/json" \
-d '{
"blueprint_id": "bp_01JX",
"trigger": { "type": "cron", "expression": "0 9 * * 1-5" }
}'Schedule events are delivered via webhooks: schedule.run.created, schedule.run.completed, schedule.run.failed, schedule.run.needs_human. See Schedules & automation for the full reference.
List, inspect, and manage blueprints
const { blueprints } = await cadreen.blueprints.list({ status: "active" });
for (const bp of blueprints) {
console.log(bp.name, bp.version, bp.status);
}const { runs } = await cadreen.blueprints.listRuns("bp_01JX", { limit: 10 });
for (const run of runs) {
console.log(run.status, run.params, run.result_summary);
}cadreen blueprints # list all
cadreen blueprints show bp_01JX # view details
cadreen blueprints runs bp_01JX # view run history
cadreen blueprints archive bp_01JX # archive (soft delete)