Documentation menu
Start here
IntroductionGetting startedWrite an agentProject anatomyUnderstand Ayjnt
Harness engineeringTwo runtimesHuman interfacesHow agents workHost bridgeAgent capabilities
Callable methodsState & SQLiteSessions & memorySchedulingWorkflowsDurable executionInter-agent RPCSub-agentsToolsWebAssembly modulesInterfaces & integrations
Browser clientRouting & middlewareVoiceBrowser toolsMCPEmailObservabilityCLI
Command overviewnewdevrunbuildcompilemigratedeployAPI reference
AgentAgentClientWorkflow classesLocal & cloudMigrationsExamplesWorkflows
Use durable steps for multi-stage work that must survive retries, pauses, and human approval.
Co-located AgentWorkflow
Place workflow.ts beside agent.ts. Extend AgentWorkflow when the workflow should call back into the originating agent, report progress, update state, or wait for approval.
import {
AgentWorkflow,
type AgentWorkflowEvent,
type AgentWorkflowStep,
} from "ayjnt/workflows";
type Params = { documentId: string };
export default class ReviewWorkflow extends AgentWorkflow<Params> {
async run(
event: Readonly<AgentWorkflowEvent<Params>>,
step: AgentWorkflowStep,
) {
const result = await step.do("analyze", async () => {
return analyze(event.payload.documentId);
});
await step.reportComplete(result);
return result;
}
}Start it from the agent
Co-location is the relationship: extend Ayjnt’s Agent and call this.workflow(params). Generated declarations carry the workflow payload type into the agent, so there is no agent-name generic, mixin, or binding string to repeat.
import { Agent, callable } from "ayjnt";
export default class ReviewAgent extends Agent {
@callable()
async start(documentId: string) {
return this.workflow({ documentId });
}
}