Workflows in the SDK
client.workflows — CRUD, copy, move, and version management for workflow definitions.
On this page4
client.workflows
All list/create methods require a spaceId (workspace UUID).
| Method | Description |
|---|---|
list(spaceId, options?) | AsyncGenerator<Workflow> |
listPage(spaceId, options?) | PaginatedResponse<Workflow> |
get(id, options?) | Single workflow |
create(spaceId, data, options?) | { name, description?, project_info? } |
update(id, data, options?) | Metadata update |
delete(id, options?) | Delete workflow |
copy(id, targetSpaceId, options?) | Copy to another space |
move(id, targetSpaceId, options?) | Move to another space |
getVersion(workflowId, versionId?, options?) | Fetch a version snapshot |
saveVersion(workflowId, data, options?) | Persist graph JSON as a new version |
const workflow = await client.workflows.create(spaceId, {
name: 'Recon Pipeline',
description: 'Subdomain → probe → scan',
})
const copied = await client.workflows.copy(workflow.id, otherSpaceId)
const version = await client.workflows.getVersion(workflow.id)Types
Exported from @trickest/sdk:
Workflow,CreateWorkflow,UpdateWorkflow,WorkflowVersion
Use Zod validation on responses when shapes are critical:
import { z } from 'zod'
const WorkflowSchema = z.object({
id: z.string(),
name: z.string(),
})
const wf = await client.workflows.get(id, { schema: WorkflowSchema })Relationship to runs and database
- Execute:
client.runs.execute(workflow.id, …)— see Runs & schedules. - Live Tables:
client.database.listByWorkflow(workflowId)andresolveByName(name, workflowId).