GUIDES
Engine
A model can answer; the Engine can finish the work. It’s the execution layer that wraps adaptive intelligence in deterministic structure, so outcomes are repeatable, verified and shippable.
Workflows
A workflow is an ordered set of steps. Each step can call a model, run a tool, generate media, or branch on a result, giving you control around the parts that should be non-negotiable.
import { Taskclan, workflow, step } from "@taskclan/sdk";
const publishPost = workflow({
name: "publish_post",
steps: [
step.run({ id: "draft", profile: "t1-flow", goal: "Draft a post from these notes" }),
step.generate({ id: "hero", modality: "image", promptFrom: "draft" }),
step.evaluate({ id: "check", policy: ["brand", "rights"] }),
step.tool({ id: "publish", tool: publishToCms, when: "check.passed" }),
],
});Run a workflow
const taskclan = new Taskclan({ apiKey: process.env.TASKCLAN_API_KEY });
const run = await taskclan.engine.run(publishPost, {
input: { notes: "Launch recap: 3 highlights, friendly tone" },
});
console.log(run.status, run.steps.publish.output);The evaluation layer
Before anything ships, the Engine can verify output quality, policy compliance, rights and business outcome. Gate side-effecting steps on evaluation so nothing risky goes out the door.
| Check | Verifies |
|---|---|
quality | Output meets a quality bar for the task |
policy | Content and actions comply with your policies |
rights | Generated media is safe to use |
outcome | Custom business checks you define |
Tool execution
Steps can act through the same typed tools your agents use, APIs, browsers, internal systems, so a workflow doesn’t just produce content, it delivers it.
Determinism where it matters. Use workflows when the shape of the work is known and reliability is the goal; use a single agent run when the path should be discovered dynamically.
