Repository navigation
Add the Go workflow tutorials - #1398
Open
nelson-parente wants to merge 17 commits into
Open
nelson-parente wants to merge 17 commits into
nelson-parente wants to merge 17 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LWoz3gpTsSSL3KbxrLqcW1 Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
With one main package in an app folder, go build ./... writes a binary named after the folder, which already exists. Build to /dev/null. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the Python workflow fundamentals tutorial to Go. A basic app registers
a workflow with two activities that run in sequence, and exposes
POST /start/{input} on port 5254 to schedule an instance. It uses
durabletask-go v0.15.1 and go-sdk v1.16.0, with the run files, the .http
file and the README of the Python tutorial.
Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port of the Python task-chaining tutorial. ChainingWorkflow calls Activity1, Activity2 and Activity3 in sequence. POST /start on port 5255 starts an instance with the input "This". App id chaining, Dapr HTTP port 3555. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the Python fan-out/fan-in tutorial to Go. The workflow starts one GetWordLength activity for each word of the input, waits for all of them and returns the shortest word. The tutorial follows the layout of the Go fundamentals tutorial. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rial Port the external system interaction tutorial to Go. An order workflow requests an external approval when the total price is above 250 dollars. It waits up to two minutes for the approval-event with WaitForExternalEvent. The workflow accepts the event payload as a JSON object (Dapr HTTP API) or as a JSON string that holds the object (Dapr CLI). Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the Python child workflows tutorial to Go. A parent workflow starts one child workflow for each item of the input array and waits for all of them. The child workflow chains two activities. The app uses the Dapr Workflow Go SDK and net/http, and runs with `dapr run -f .`. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rial Port the Python resiliency-and-compensation tutorial to Go. The workflow calls an activity with a retry policy, runs a compensating activity when the activity fails, and sets a custom status. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the monitor pattern tutorial to Go with the durabletask-go workflow package. The workflow calls an activity, waits on a durable timer when the resource is not ready, and continues as a new instance with a higher counter. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the Python versioning tutorial to Go. A NotifyUser workflow sends an email, then an SMS. Three stages: the original workflow, named versions (AddVersionedWorkflow) and patching (WorkflowContext.IsPatched). The stage is selected with a Go build tag in the command field of dapr.yaml. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the Python challenges-tips snippets (deterministic workflows, idempotent activities, payload size) to Go with durabletask-go v0.15.1. The module compiles with go vet and has no run. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the combined-patterns workflow tutorial to Go. Two apps (workflowapp and shippingapp) run an order workflow that combines fan-out/fan-in, task chaining, an external event and compensation. The activities use the Dapr state, service invocation and pub/sub APIs with Redis. The tutorial has no SQLite run file because no SQLite pub/sub component exists. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the workflow-management tutorial to Go. HTTP endpoints use the workflow client of durabletask-go v0.15.1 and go-sdk v1.16.0 to schedule, query, suspend, resume, terminate and purge a workflow instance. The README describes the run with Redis and the run without Docker. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e index The Go tutorial index lists the eleven Go tutorials. The tutorial matrix runs each runnable Go tutorial, and the combined-patterns job runs the Go version with the Redis service. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The language table in the workflow tutorials README listed only history propagation for Go. It now lists the same topics as Python. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- monitor-pattern: POST /start/{counter} now rejects a negative counter
with 400. Before, the workflow started, and CheckStatus called
rand.IntN(0), which panics.
- workflow-management: GET /status/{instance_id} now returns 404 when no
workflow instance has that ID (api.ErrInstanceNotFound). Before, it
returned 500. The C# tutorial also returns 404 for this case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
nelson-parente
force-pushed
the
tutorials-go
branch
from
November 9, 2026 12:19
37929e1 to
9b38cae
Compare
nelson-parente
marked this pull request as ready for review
November 9, 2026 13:04
Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request builds on #1394 and #1396 and contains their commits. Review those two pull requests first. After they merge, the diff of this pull request shows only the Go tutorial changes.
The workflow tutorials exist for Python, .NET and Java. Go had one tutorial,
history-propagation. This pull request adds the other ten topics and thechallenges-tipssnippets in Go. They use the same scenarios, endpoints, ports, app IDs and.httprequests as the Python tutorials.Changes
tutorials/workflow/go/:fundamentals,task-chaining,fan-out-fan-in,external-system-interaction,child-workflows,resiliency-and-compensation,monitor-pattern,workflow-management,versioning,combined-patternsandchallenges-tips. They usedurabletask-gov0.15.1 andgo-sdkv1.16.0, the pins ofworkflows/go/sdk.versioningkeeps the three stages of the Python tutorial as files with Go build tags.validate.shbuilds Go tutorials withgo build -o /dev/null ./..., so the build writes no binary.tutorials/workflow/README.mdlist every Go tutorial.validate_tutorials.yamlruns the runnable Go tutorials on SQLite, and Gocombined-patternsin the Redis job.Tests
Each tutorial ran in a clean Ubuntu 24.04 container with Dapr CLI and runtime 1.19.0 and Go 1.26.10:
bash tutorials/workflow/validate.sh go <topic>: all ten pass.history-propagationalso passes after thevalidate.shchange.versioningpasses in all three stages.gofmt -landgo vet ./...are clean for each module.🤖 Generated with Claude Code