Repository navigation
quickstart for workflows history propagation - #1315
Conversation
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
There was a problem hiding this comment.
Pull request overview
This PR restructures the workflows/go/sdk area into a multi-example “landing page” layout and introduces a new Go workflow quickstart demonstrating workflow history propagation (patient intake / e-prescribing scenario).
Changes:
- Replaces the single long Go SDK README with a landing page that links to multiple examples.
- Adds a new
patient-intakeexample that demonstratesPropagateLineage()vsPropagateOwnHistory()and downstream verification of upstream steps. - Updates
workflows/go/sdkbuild/validate workflow to fan out to sub-example makefiles; adjustsorder-processorsupporting files accordingly.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| workflows/go/sdk/README.md | New landing page describing available Go workflow examples and how to run them. |
| workflows/go/sdk/makefile | Fans make targets out to subdirectories that contain a makefile. |
| workflows/go/sdk/order-processor/README.md | Moves the original order-processor documentation into the example folder. |
| workflows/go/sdk/order-processor/makefile | Adds per-example makefile including shared docker.mk/validate.mk. |
| workflows/go/sdk/order-processor/dapr.yaml | Fixes paths to match the new directory structure (resourcesPath, appDirPath). |
| workflows/go/sdk/patient-intake/main.go | New runnable demo app that starts a worker, schedules one workflow instance, waits, and exits. |
| workflows/go/sdk/patient-intake/workflow.go | Implements workflows/activities and history-inspection helpers for the propagation demo. |
| workflows/go/sdk/patient-intake/models.go | Defines model types used as workflow/activity inputs/outputs. |
| workflows/go/sdk/patient-intake/README.md | Documents the propagation scenario, scope modes, and run instructions. |
| workflows/go/sdk/patient-intake/go.mod | Adds a new module for the example (currently using a fork via replace). |
| workflows/go/sdk/patient-intake/go.sum | Dependency lockfile for the new example module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Aligns the Python workflow history propagation quickstart with the canonical Go reference (dapr/go-sdk#823, dapr#1315) so all SDK quickstarts share the same patient intake / e-prescribing scenario. - Swap credit-card/fraud scenario for patient-intake/e-prescribing - Adopt PatientIntake -> PrescribeMedication -> ComplianceAudit hierarchy - Add is_replaying guards around all print() calls inside workflows - Use Cassie's PascalCase activity/workflow names for cross-SDK consistency Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
Aligns the .NET workflow history propagation quickstart with the canonical Go reference (dapr/go-sdk#823, dapr#1315) so all SDK quickstarts share the same patient intake / e-prescribing scenario. - Swap credit-card/fraud scenario for patient-intake/e-prescribing - Adopt PatientIntake -> PrescribeMedication -> ComplianceAudit hierarchy - Add IsReplaying guards around all Console.WriteLine inside workflows - DispenseMedicationWorkflow still wraps the activity for OwnHistory (.NET SDK propagation is on ChildWorkflowTaskOptions only) - Add event-level history walking in DispenseMedicationWorkflow Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
alicejgibbons
left a comment
There was a problem hiding this comment.
@cicoyle can we update this to the 1.18 release branch and move it to the tutorials section. The folder should be something like history-propagation: https://github.com/dapr/quickstarts/tree/master/tutorials/workflow
Even though there is no go parent folder for now this is fine, we can always add the other go sections later :)
|
I would be keen on a negative scenario to see the pharmacy refusing to dispense because it receives missing history/lineage |
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Aligns the Python workflow history propagation quickstart with Cassie's canonical Go version that merged into release-1.18 (dapr#1315, tutorials/workflow/go/history-propagation). Changes to match the canonical structure: - Move from workflows/python/sdk-context-propagation/order-processor/ to tutorials/workflow/python/history-propagation/, matching the Go sibling at tutorials/workflow/go/history-propagation/ - Split the monolithic app.py into app.py / workflow.py / models.py, mirroring main.go / workflow.go / models.go - Add ForwardLineage flag to PatientRecord and run both scenarios back-to-back (happy path + negative), purging state after each so the app exits on its own - Make DispenseMedication refuse to dispense when no propagated history is received, returning a refused DispenseResult with a Reason field - Match the Go README: title, propagation-scope table, STEP markers, expected output for both scenarios - dapr.yaml: appID=patient-app (was order-processor), resourcesPath=../../resources (was ../../components), appLogDestination/daprdLogDestination=console to match sister Python tutorials and Cassie's Go example - Use correct Python SDK API names: get_last_workflow_by_name / get_last_activity_by_name (the earlier draft used get_workflow_by_name / get_activity_by_name, which were renamed in dapr/python-sdk#1025) Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
go-sdk example: scenario is a patient intake / e-prescribing pipeline.
Before merging, I need to update the go.mod versions.