@personaai/sdkv0.9.0

workflows — @personaai/sdk

Generated field tables for workflows — do not edit

Generated from sdk/typescript/dist/typedoc.json — do not edit. Regenerate with node platform/scripts/typedoc-resources.mjs.

workflows

Auth: Requires Authorization: Bearer <keyId>.<secret> (server-side). For per-user calls add x-persona-external-user-id. See .

Workflows are multi-agent DAGs compiled to LangGraph StateGraphs — draft (editable) + publishedVersion (immutable). Stream via AG-UI with seq for resume and dryRun for safe testing.

Example

TypeScript

ts
const wf = await persona.workflows.create({ name: 'Research', draft: { nodes, edges, trigger: { type: 'manual' } } });const result = await persona.workflows.run(wf._id, { input: { query: 'trends' } });for await (const e of persona.workflows.stream(wf._id, { input: { query: '...' } })) {}

cURL

bash
curl https://api.persona.hasanraiyan.me/api/v1/developer/workflows/WF_ID/runs -H "Authorization: Bearer $PERSONA_CREDENTIAL" -H "Content-Type: application/json" -d '{"input":{"query":"trends"}}'

Response

json
{  "success": true,  "data": { "runId": "run_123", "status": "completed", "output": { "summary": "..." } }}

Workflow

Source: types/workflow.ts:61

Interface

FieldTypeDescription
_idstring— _ types/workflow.ts:62_
domain?string— _ types/workflow.ts:63_
projectId?string— _ types/workflow.ts:64_
namestring— _ types/workflow.ts:65_
description?string— _ types/workflow.ts:66_
isEnabledboolean— _ types/workflow.ts:67_
visibilityWorkflowVisibility— _ types/workflow.ts:68_
ownerTypeWorkflowOwnerType— _ types/workflow.ts:69_
externalOwnerId?string | null— _ types/workflow.ts:70_
draftWorkflowDraft— _ types/workflow.ts:71_
publishedVersionnumber— _ types/workflow.ts:72_
activeRunsnumber— _ types/workflow.ts:73_
createdAtstring— _ types/workflow.ts:74_
updatedAtstring— _ types/workflow.ts:75_

WorkflowNodeType

Source: types/workflow.ts:3

Kind 2097152

ts
type WorkflowNodeType = "trigger" | "agentStep" | "knowledgeStep" | "toolStep" | "condition" | "approval" | "parallel" | "join" | "output"

WorkflowTriggerType

Source: types/workflow.ts:14

Kind 2097152

ts
type WorkflowTriggerType = "manual" | "api" | "webhook" | "schedule" | "chat"

WorkflowVisibility

Source: types/workflow.ts:15

Kind 2097152

ts
type WorkflowVisibility = "private" | "unlisted" | "public"

WorkflowOwnerType

Source: types/workflow.ts:16

Kind 2097152

ts
type WorkflowOwnerType = "Project" | "ExternalUser"

NodeOnErrorAction

Source: types/workflow.ts:17

Kind 2097152

ts
type NodeOnErrorAction = "fail" | "continue" | "routeError"

NodeRetryPolicy

Source: types/workflow.ts:19

Interface

FieldTypeDescription
maxRetries?number— _ types/workflow.ts:20_
backoffMs?number— _ types/workflow.ts:21_
exponential?boolean— _ types/workflow.ts:22_

WorkflowNodeData

Source: types/workflow.ts:25

Interface

FieldTypeDescription
labelstring— _ types/workflow.ts:26_
description?string— _ types/workflow.ts:27_
config?Record<string, unknown>— _ types/workflow.ts:28_
retryPolicy?NodeRetryPolicy— _ types/workflow.ts:29_
onError?NodeOnErrorAction— _ types/workflow.ts:30_

WorkflowNode

Source: types/workflow.ts:33

Interface

FieldTypeDescription
idstring— _ types/workflow.ts:34_
typeWorkflowNodeType— _ types/workflow.ts:35_
position?{ x: number; y: number }— _ types/workflow.ts:36_
dataWorkflowNodeData— _ types/workflow.ts:37_

WorkflowEdge

Source: types/workflow.ts:40

Interface

FieldTypeDescription
idstring— _ types/workflow.ts:41_
sourcestring— _ types/workflow.ts:42_
targetstring— _ types/workflow.ts:43_
sourceHandle?string— _ types/workflow.ts:44_
targetHandle?string— _ types/workflow.ts:45_
condition?unknown— _ types/workflow.ts:46_
conditionValue?string— _ types/workflow.ts:47_

WorkflowTrigger

Source: types/workflow.ts:50

Interface

FieldTypeDescription
typeWorkflowTriggerType— _ types/workflow.ts:51_
config?Record<string, unknown>— _ types/workflow.ts:52_

WorkflowDraft

Source: types/workflow.ts:55

Interface

FieldTypeDescription
nodesWorkflowNode[]— _ types/workflow.ts:56_
edgesWorkflowEdge[]— _ types/workflow.ts:57_
trigger?WorkflowTrigger— _ types/workflow.ts:58_

AgentSnapshot

Source: types/workflow.ts:78

Interface

FieldTypeDescription
modelNamestring— _ types/workflow.ts:79_
systemPromptstring— _ types/workflow.ts:80_
tools?string[]— _ types/workflow.ts:81_

WorkflowVersion

Source: types/workflow.ts:84

Interface

FieldTypeDescription
_idstring— _ types/workflow.ts:85_
workflowIdstring— _ types/workflow.ts:86_
projectIdstring— _ types/workflow.ts:87_
versionnumber— _ types/workflow.ts:88_
definitionWorkflowDraft— _ types/workflow.ts:89_
agentSnapshots?Record<string, AgentSnapshot>— _ types/workflow.ts:90_
publishedBy?string— _ types/workflow.ts:91_
publishedAtstring— _ types/workflow.ts:92_
createdAtstring— _ types/workflow.ts:93_
updatedAtstring— _ types/workflow.ts:94_

WorkflowRunStatus

Source: types/workflow.ts:97

Kind 2097152

ts
type WorkflowRunStatus = "queued" | "running" | "paused" | "completed" | "failed" | "cancelled"

NodeRunStatus

Source: types/workflow.ts:105

Kind 2097152

ts
type NodeRunStatus = "running" | "completed" | "failed" | "skipped" | "paused"

NodeRun

Source: types/workflow.ts:107

Interface

FieldTypeDescription
nodeIdstring— _ types/workflow.ts:108_
nodeTypestring— _ types/workflow.ts:109_
statusNodeRunStatus— _ types/workflow.ts:110_
input?unknown— _ types/workflow.ts:111_
output?unknown— _ types/workflow.ts:112_
error?string— _ types/workflow.ts:113_
retriesTakennumber— _ types/workflow.ts:114_
durationMsnumber— _ types/workflow.ts:115_
tokensnumber— _ types/workflow.ts:116_
startedAtstring— _ types/workflow.ts:117_
endedAt?string— _ types/workflow.ts:118_

WorkflowUsage

Source: types/workflow.ts:121

Interface

FieldTypeDescription
totalTokensnumber— _ types/workflow.ts:122_
agentTurnsnumber— _ types/workflow.ts:123_
toolCallsnumber— _ types/workflow.ts:124_
creditsDeductednumber— _ types/workflow.ts:125_

WorkflowRun

Source: types/workflow.ts:128

Interface

FieldTypeDescription
_idstring— _ types/workflow.ts:129_
workflowIdstring— _ types/workflow.ts:130_
workflowVersionnumber— _ types/workflow.ts:131_
projectIdstring— _ types/workflow.ts:132_
triggeredBy{ type: WorkflowTriggerType; userId: string; details: unknown }— _ types/workflow.ts:133_
statusWorkflowRunStatus— _ types/workflow.ts:138_
isDryRunboolean— _ types/workflow.ts:139_
nodeRunsNodeRun[]— _ types/workflow.ts:140_
pendingApproval?{ nodeId: string; prompt: string; options: string[]; requestedAt: string }— _ types/workflow.ts:141_
output?unknown— _ types/workflow.ts:147_
usage?WorkflowUsage— _ types/workflow.ts:148_
threadIdstring— _ types/workflow.ts:149_
startedAtstring— _ types/workflow.ts:150_
endedAt?string— _ types/workflow.ts:151_
createdAtstring— _ types/workflow.ts:152_
updatedAtstring— _ types/workflow.ts:153_

CreateWorkflowInput

Source: types/workflow.ts:156

Interface

FieldTypeDescription
namestring— _ types/workflow.ts:157_
description?string— _ types/workflow.ts:158_
visibility?WorkflowVisibility— _ types/workflow.ts:159_
isEnabled?boolean— _ types/workflow.ts:160_
draft?WorkflowDraft— _ types/workflow.ts:161_

UpdateWorkflowInput

Source: types/workflow.ts:164

Interface

FieldTypeDescription
name?string— _ types/workflow.ts:165_
description?string— _ types/workflow.ts:166_
visibility?WorkflowVisibility— _ types/workflow.ts:167_
isEnabled?boolean— _ types/workflow.ts:168_
draft?WorkflowDraft— _ types/workflow.ts:169_

DiscoverWorkflowsParams

Source: types/workflow.ts:172

Interface

FieldTypeDescription
page?number— _ types/workflow.ts:173_
limit?number— _ types/workflow.ts:174_
search?string— _ types/workflow.ts:175_
scope?"mine" | "public" | "all"— _ types/workflow.ts:176_
visibility?WorkflowVisibility— _ types/workflow.ts:177_
isEnabled?boolean— _ types/workflow.ts:178_

ListWorkflowRunsParams

Source: types/workflow.ts:181

Interface

FieldTypeDescription
page?number— _ types/workflow.ts:182_
limit?number— _ types/workflow.ts:183_
status?WorkflowRunStatus— _ types/workflow.ts:184_
isDryRun?boolean— _ types/workflow.ts:185_

ListWorkflowVersionsParams

Source: types/workflow.ts:188

Interface

FieldTypeDescription
page?number— _ types/workflow.ts:189_
limit?number— _ types/workflow.ts:190_

RunWorkflowOptions

Source: types/workflow.ts:193

Interface

FieldTypeDescription
input?unknown— _ types/workflow.ts:194_
dryRun?boolean— _ types/workflow.ts:195_
version?number— _ types/workflow.ts:196_
signal?AbortSignal— _ types/workflow.ts:197_

WorkflowRunResult

Source: types/workflow.ts:200

Interface

FieldTypeDescription
runIdstring— _ types/workflow.ts:201_
threadIdstring— _ types/workflow.ts:202_
statusWorkflowRunStatus— _ types/workflow.ts:203_
isDryRunboolean— _ types/workflow.ts:204_
outputunknown— _ types/workflow.ts:205_
usage?WorkflowUsage— _ types/workflow.ts:206_
nodeRunsRecord<string, NodeRun>— _ types/workflow.ts:207_
eventsWorkflowStreamEvent[]— _ types/workflow.ts:208_

WorkflowStreamEvent

Source: types/workflow.ts:211

Kind 2097152

ts
type WorkflowStreamEvent = AguiEvent & { seq: number; parentStepId: string }