Simple workflows to help you get started with Pocket. Each example demonstrates a specific concept.
The simplest possible workflow - outputs a message.
name: hello-world
start: greet
nodes:
- name: greet
type: echo
config:
message: "Hello from Pocket!"Run it: pocket run hello.yaml
Demonstrates nodes executing one after another with delays.
name: sequential-processing
start: step1
nodes:
- name: step1
type: echo
config:
message: "Starting process..."
- name: wait
type: delay
config:
duration: "2s"
- name: step2
type: echo
config:
message: "Process complete!"
connections:
- from: step1
to: wait
- from: wait
to: step2Shows how to route based on data values.
name: conditional-routing
start: check
nodes:
- name: check
type: conditional
config:
conditions:
- if: "{{gt .score 80}}"
then: excellent
- if: "{{gt .score 60}}"
then: good
else: needs-improvement
- name: excellent
type: echo
config:
message: "Excellent score!"
- name: good
type: echo
config:
message: "Good job!"
- name: needs-improvement
type: echo
config:
message: "Keep practicing!"Demonstrates the router node for predefined paths.
name: static-routing
start: router
nodes:
- name: router
type: router
config:
routes:
path1: handler1
path2: handler2
default: default-handlerShows how to use Go templates to format output.
name: template-example
start: render
nodes:
- name: render
type: template
config:
template: |
Welcome {{.name}}!
Your account type is: {{.type}}
Status: {{if .active}}Active{{else}}Inactive{{end}}All examples can be found in the /examples/cli/ directory:
# Run any example
pocket run examples/cli/hello.yaml
# Run with verbose output to see execution flow
pocket run examples/cli/sequential.yaml --verbose
# Validate without running
pocket run examples/cli/conditional.yaml --dry-run- Node Types: Different built-in nodes (echo, delay, router, conditional, template)
- Connections: How to connect nodes explicitly
- Routing: Both static (router) and dynamic (conditional) routing
- Templates: Using Go templates for dynamic content
- Configuration: Various configuration options for each node type
Once you're comfortable with these basics:
- Try the Advanced Examples
- Learn about Data Processing
- Explore External Integrations