You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add support for gating rollouts behind successful workflow executions (#152)
<!--- Note to EXTERNAL Contributors -->
<!-- Thanks for opening a PR!
If it is a significant code change, please **make sure there is an open
issue** for this.
We work best with you when we have accepted the idea first before you
code. -->
This PR adds support for custom inputs to the "gate" workflow, which was
originally part of the docs but I discovered was not implemented when I
tried to use it 😅.
<!--- For ALL Contributors 👇 -->
## What was changed
<!-- Describe what has changed in this PR -->
This PR includes a few changes:
1. Gated workflow input specification support both in-line and as a
ConfigMap
2. Moved CRDs to top level chart directory, which ensures they are
installed first per [helm
docs](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-1-let-helm-do-it-for-you)
3. Because of 2, TemporalConnection can now be added to the helm
templates/values definitions
4. Relevant docs updates
## Why?
<!-- Tell your future self why have you made these changes -->
Gated workflow success for our use case really depends on being able to
specify exactly the workflow inputs.
## Checklist
<!--- add/delete as needed --->
### Closes
<!-- add issue number here -->
Here is the [link to temporal community slack
thread](https://temporalio.slack.com/archives/C07MDJ6S3HP/p1759190414718889)
where I discussed with @Shivs11 and @carlydf .
### How was this tested:
<!--- Please describe how you tested your changes/how we can test them
-->
Already deployed in our staging cluster, using configMap with a huge
workflow input. This workflow must complete successfully or the new
workers will not roll out.
### Any docs updates needed?
<!--- update README if applicable or point out where to update
docs.temporal.io -->
Updated docs accordingly.
Copy file name to clipboardExpand all lines: docs/architecture.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,28 @@ Here is an example of a progressive cut-over strategy gated on the success of th
71
71
workflowType: "HelloWorld"
72
72
```
73
73
74
+
### Gate Input Flow
75
+
76
+
When `spec.rollout.gate` is configured, the controller starts one test workflow per task queue in the Target Version. If gate input is provided, it is passed as the first workflow argument:
77
+
78
+
```yaml
79
+
rollout:
80
+
gate:
81
+
workflowType: "RolloutGate"
82
+
# Inline JSON object
83
+
input:
84
+
thresholds:
85
+
errorRate: 0.01
86
+
p95LatencyMs: 250
87
+
# Or reference ConfigMap/Secret (JSON document)
88
+
# inputFrom:
89
+
# configMapKeyRef:
90
+
# name: my-gate-input
91
+
# key: payload.json
92
+
```
93
+
94
+
Input resolution happens in the controller before invoking the workflow. The payload must be a JSON object and is not logged, except for size and a short preview for debugging.
Copy file name to clipboardExpand all lines: docs/concepts.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,15 @@ Configuration that tells the controller how to connect to the same Temporal clus
95
95
Defines how new versions are promoted:
96
96
-**strategy**: Manual, AllAtOnce, or Progressive
97
97
-**steps**: For Progressive strategy, defines ramp percentages and pause durations
98
-
-**gate**: Optional workflow that must succeed on all task queues in the target Worker Deployment Version before promotion continues
98
+
-**gate**: Optional workflow that must succeed on all task queues in the target Worker Deployment Version before promotion continues. Gate can receive an input payload:
99
+
-`workflowType`: The workflow name/type to execute for validation
100
+
-`input`: Inline JSON object passed as the first workflow argument
101
+
-`inputFrom`: Reference to a `ConfigMap` or `Secret` key whose contents are JSON; passed as the first workflow argument
102
+
103
+
Notes on gate inputs:
104
+
- Exactly one of `input` or `inputFrom` may be set.
105
+
- The value must be a JSON object (not a string containing JSON).
106
+
- Large/sensitive payloads should use `inputFrom.secretKeyRef` or split into smaller documents.
0 commit comments