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
Copy file name to clipboardExpand all lines: docs/source/includes/_faq.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,8 @@ and only if a workflow instance was created with a version of `>= 2` will `Activ
75
75
76
76
This kind of check is understandable for simple changes, but it becomes hard and a source of bugs for more complicated workflows. Therefore for now versioning is not supported and the guidance is to rely on **side-by-side** deployments. See also Azure's [Durable Functions](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-versioning) documentation for the same topic.
77
77
78
+
In addition to side-by-side deployments, you can use [Queues](#queues) to route workflows to different workers based on their version.
79
+
78
80
## How to safely upgrade?
79
81
80
82
All backend implementations have limited support for migrations which by default are automatically executed when a backend is started. This generally assumes only a single running worker. If you use multiple workers, you need to synchronize migration execution yourself.
If you need to run any activities or make calls using `workflow.Context` you need to create a new context with `workflow.NewDisconnectedContext`, since the original context is canceled at this point.
All workers have the same simple interface. You can register workflows and activities, start the worker, and when shutting down wait for all pending tasks to be finished.
186
+
187
+
## Queues
188
+
189
+
Workers can pull workflow and activity tasks from different queues. By default workers listen to two queues:
190
+
191
+
-`default`
192
+
-`_system_` for system workflows and activities
193
+
194
+
For now, every worker will _always_ pull from `_system_`, but you can configure other queues you want to listen to. All worker options `struct`s take a `Queues` option.
195
+
196
+
When starting workflows, creating sub-workflow instances, or scheduling activities you can pass a queue you want the task to be scheduled on.
197
+
198
+
The default behavior if no explicit queue is given:
199
+
200
+
-**Starting a workflow**: the default queue is `default`.
201
+
-**Creating a sub-workflow instance**: the default behavior is to inherit the queue from the parent workflow instance.
202
+
-**Scheduling an activity**: the default behavior is to inherit the queue from the parent workflow instance.
203
+
158
204
## Executing activities
159
205
160
206
```go
@@ -168,6 +214,23 @@ log.Println(r1)
168
214
169
215
From a workflow, call `workflow.ExecuteActivity` to execute an activity. The call returns a `Future[T]` you can await to get the result or any error it might return.
return errors.Wrap(err, "could not get sub workflow result")
352
+
}
353
+
```
354
+
355
+
<divstyle="clear: both"></div>
356
+
278
357
### Canceling sub-workflows
279
358
280
359
Similar to timer cancellation, you can pass a cancelable context to `CreateSubWorkflowInstance` and cancel the sub-workflow that way. Reacting to the cancellation is the same as canceling a workflow via the `Client`. See [Canceling workflows](#canceling-workflows) for more details.
Copy file name to clipboardExpand all lines: docs/source/includes/_samples.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,10 @@ Shows how to handle errors in workflows and activities.
36
36
37
37
Demonstrates sub-workflow and activity retries.
38
38
39
+
## Queues
40
+
41
+
Shows how to queue workflows and activities to different queues and how to create workers that only listen for specific queues or specific tasks (workflows or activities).
42
+
39
43
## Scale
40
44
41
45
Simple sample with a split worker and "starter" process.
0 commit comments