Skip to content

mnichols/go-temporal-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go temporal sample

This simple sample demonstrates how to execute a workflow that, upon encountering a failure, notifies a user so that they might correct the erroneous input.

To Simulate

Start local dev server as: temporal server start-dev

Then in another terminal start the worker: go run cmd/backend/main.go

Finally issue these commands to spoof a failure: )

# start the workflow with a bad SubscriptionID of "GarbageSubscriptionID"
temporal workflow start --type OnboardApplication \
    --workflow-id foo \
    --input-file onboard_application.json \
    --task-queue apps
    
# observe that:
# 1. the "SetupJFrog" activity has failed due to having this SubscriptionID
# 2. the workflow detects this BadSubscriptionIDErr so RequestsCorrection  
    
# send a signal to the workflow to correct the bad SubscriptionID
temporal workflow signal --name correctSubscriptionID \
    --input '{"subscriptionId": "123"}' 
    --workflow-id foo
    
# observe that the workflow re-calls the SetupJFrog activity and exits

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages