Workflow SDK Examples

Select a workflow to start a run and view its output

Available Workflows

workflows/1_simple.ts

simple

(1 arg)
[
  42
]

workflows/10_single_stmt_control_flow.ts

single_statement_for

single_statement_if

single_statement_while

workflows/100_durable_agent_e2e.ts

agentBasicE2e

(1 arg)
[
  "hello world"
]

agentConstructorPrepareStepE2e

agentErrorToolE2e

agentInstructionsStringE2e

agentMixedToolsE2e

agentMultimodalToolResultE2e

agentMultiStepE2e

agentOnFinishE2e

agentOnStartE2e

agentOnStepFinishE2e

agentOnStepStartE2e

agentOnToolCallFinishE2e

agentOnToolCallStartE2e

agentPrepareCallE2e

agentProviderToolE2e

agentStreamPrepareStepOverrideE2e

agentTimeoutE2e

agentToolApprovalE2e

agentToolCallE2e

(2 args)
[
  3,
  7
]

workflows/2_control_flow.ts

control_flow

workflows/3_streams.ts

streams

workflows/4_ai.ts

agent

(1 arg)
[
  "What is the weather in Muscat?"
]

ai

(1 arg)
[
  "What is the weather in San Francisco?"
]

workflows/5_hooks.ts

withCreateHook

withWorkflowMetadata

workflows/6_batching.ts

batchInStep

batchOverSteps

workflows/7_full.ts

handleUserSignup

(1 arg)
[
  "user@example.com"
]

workflows/8_react_render.tsx

reactWorkflow

workflows/96_many_steps.ts

twoHundredStepsWorkflow

workflows/97_bench.ts

concurrentDataPayloadWorkflow

fanOutFanInStreamWorkflow

noStepsWorkflow

(1 arg)
[
  42
]

oneStepWorkflow

(1 arg)
[
  10
]

parallelStreamsWorkflow

promiseAllStressTestWorkflow

(1 arg)
[
  5
]

promiseRaceStressTestLargeWorkflow

(1 arg)
[
  5
]

sequentialDataPayloadWorkflow

sequentialStepsWorkflow

streamPipelineWorkflow

streamWorkflow

tenParallelStepsWorkflow

tenSequentialStepsWorkflow

workflows/98_duplicate_case.ts

addTenWorkflow

(1 arg)
[
  123
]

workflows/99_e2e.ts

addTenWorkflow

(1 arg)
[
  123
]

childWorkflow

childWorkflowWithHookSignal

closureVariableWorkflow

(1 arg)
[
  7
]

crossContextSerdeWorkflow

crossFileErrorWorkflow

customSerializationWorkflow

errorFatalCatchable

errorRetryCustomDelay

errorRetryDisabled

errorRetryFatal

errorRetrySuccess

errorStepBasic

errorStepCrossFile

errorWorkflowCrossFile

errorWorkflowNested

fetchWorkflow

fibonacciWorkflow

(1 arg)
[
  3
]

getterStepWorkflow

hookCleanupTestWorkflow

(2 args)
[
  "<random-id>",
  "<random-id>"
]

hookDisposeTestWorkflow

hookWithSleepWorkflow

hookWorkflow

(2 args)
[
  "<random-id>",
  "<random-id>"
]

importedStepOnlyWorkflow

importMetaUrlWorkflow

instanceMethodStepWorkflow

maxRetriesZeroWorkflow

metadataFromHelperWorkflow

nullByteWorkflow

outputStreamInsideStepWorkflow

outputStreamWorkflow

parallelSleepWorkflow

pathsAliasWorkflow

promiseAllWorkflow

promiseAnyWorkflow

promiseRaceStressTestWorkflow

promiseRaceWorkflow

readableStreamWorkflow

retryableAndFatalErrorWorkflow

retryAttemptCounterWorkflow

runClassSerializationWorkflow

sleepingWorkflow

sleepInLoopWorkflow

sleepWithSequentialStepsWorkflow

spawnWorkflowFromStepWorkflow

startFromWorkflow

(1 arg)
[
  42
]

stepFunctionAsStartArgWorkflow

stepFunctionPassingWorkflow

stepFunctionWithClosureWorkflow

stepNotRegisteredCatchable

stepNotRegisteredUncaught

thisSerializationWorkflow

webhookWorkflow

(3 args)
[
  "<random-id>",
  "<random-id>",
  "<random-id>"
]

workflowAndStepMetadataWorkflow

workflows/agent_chat.ts

chat

Workflow Invocations
No workflow runs yet. Click "Start" on any workflow to begin.
Terminal Output
No logs yet. Start a workflow to see output...