workflow-external

command
v2.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

External Workflow Orchestration Example

Drive workflow state transitions from outside the conversation loop.

What it shows

In external orchestration mode, state transitions are triggered by outside callers (HTTP handlers, message queues, etc.) rather than from within the conversation loop. The WorkflowConversation is thread-safe for concurrent Send() and Transition() calls from different goroutines.

Running

cd sdk/examples/workflow-external
go run . -pack ./support.pack.json

Then interact over HTTP:

# Send a message to the current state's conversation
curl -X POST localhost:8080/send -d '{"message":"I need help with billing"}'

# Trigger a state transition
curl -X POST localhost:8080/transition -d '{"event":"Escalate"}'

# Check the current state
curl localhost:8080/state

Documentation

Overview

Package main demonstrates external orchestration mode for workflows.

In external orchestration mode, state transitions are triggered by outside callers (HTTP handlers, message queues, etc.) rather than from within the conversation loop. The WorkflowConversation is thread-safe for concurrent Send() and Transition() calls from different goroutines.

Usage:

go run . -pack ./support.pack.json

Then interact via HTTP:

# Send a message to the current state's conversation
curl -X POST localhost:8080/send -d '{"message":"I need help with billing"}'

# Trigger a state transition
curl -X POST localhost:8080/transition -d '{"event":"Escalate"}'

# Check current state
curl localhost:8080/state

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL