workflow-external

command
v1.5.11 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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