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
@@ -8,6 +8,7 @@ description: "Executing workflows across multiple applications"
8
8
9
9
It is often the case that a single workflow spans multiple applications, microservices, or programing languages.
10
10
This is where an activity or a child workflow will be executed on a different application than the one hosting the parent workflow.
11
+
11
12
Some scenarios where this is useful include:
12
13
13
14
- A Machine Learning (ML) training activity must be executed on GPU-enabled machines, while the rest of the workflow runs on CPU-only orchestration machines.
@@ -16,6 +17,8 @@ Some scenarios where this is useful include:
16
17
- Different parts of the workflow need to be executed in different geographic regions due to data residency requirements.
17
18
- An involved business process spans multiple teams or departments, each owning their own application.
18
19
- Implementation of a workflow spans different programming lanaguages based on team expertise or existing codebases.
20
+
- Different team boundaries or microservice ownership.
21
+
19
22
20
23
## Multi-application workflows
21
24
@@ -25,8 +28,6 @@ This workflow will be executed across all replicas of that app ID, not just the
25
28
26
29
It is possible to execute activities or child workflows on different app IDs by specifying the target app ID parameter, inside the workflow execution code.
27
30
Upon execution, the target app ID will execute the activity or child workflow, and return the result to the parent workflow of the originating app ID.
28
-
Workflows being durable, if the target activity or child workflow app ID is not available or has not been defined, the parent workflow retry until the target app ID becomes available, indefinitely.
29
-
It is paramount that their is co-ordination between the teams owning the different app IDs to ensure that the activities and child workflows are defined and available when needed.
30
31
31
32
The entire Workflow execution may be distributed across multiple app IDs with no limit, with each activity or child workflow specifying the target app ID.
32
33
The final history of the workflow will be saved by the app ID that hosts the very parent (or can consider it the root) workflow.
@@ -38,62 +39,37 @@ Similarly, all app IDs must use the same actor state store.
38
39
Finally, the target app ID must have the activity or child workflow defined, otherwise the parent workflow will retry indefinitely.
39
40
{{% /alert %}}
40
41
41
-
## Multi-application activity examples
42
-
43
-
The following examples show how to execute activities on different target app IDs.
-**SDKs supporting multi-application workflows** - Multi-application workflows are used via the SDKs. Currently Java (activities calling) and Go (both activities and child workflows calling) SDKs are supported. The SDKs (Python, .NET, JavaScript) are planned for future releases.
44
+
{{% /alert %}}
48
45
49
-
```go
50
-
package main
46
+
## Error handling
51
47
52
-
import (
53
-
"context"
54
-
"log"
48
+
When calling multi-application activities or child workflows:
49
+
- If the target application does not exist, the call will be retried using the provided retry policy.
50
+
- If the target application exists but doesn't contain the specified activity or workflow, the call will return an error.
51
+
- Standard workflow retry policies apply to multi-application calls.
55
52
56
-
"github.com/dapr/durabletask-go/backend"
57
-
"github.com/dapr/durabletask-go/client"
58
-
"github.com/dapr/durabletask-go/task"
59
-
dapr "github.com/dapr/go-sdk/client"
60
-
)
53
+
It is paramount that there is co-ordination between the teams owning the different app IDs to ensure that the activities and child workflows are defined and available when needed.
[Learn more about child workflows.]({{% ref "workflow-features-concepts.md#child-workflows" %}})
48
48
49
+
### Multi-application workflows
50
+
51
+
Multi-application workflows, enable you to orchestrate complex business processes that span across multiple applications. This allows a workflow to call activities or start child workflows in different applications, distributing the workflow execution while maintaining the security, reliability and durability guarantees of Dapr's workflow engine.
52
+
53
+
[Learn more about multi-application workflows.]({{% ref "workflow-multi-app.md" %}})
54
+
49
55
### Timers and reminders
50
56
51
57
Same as Dapr actors, you can schedule reminder-like durable delays for any time range.
With the release of 1.16, it's even easier to process workflow activities in parallel while putting an upper cap on
619
-
concurrency by using the following extension methods on the `WorkflowContext`:
618
+
You can process workflow activities in parallel while putting an upper cap on concurrency by using the following extension methods on the `WorkflowContext`:
620
619
621
620
{{< tabpane text=true >}}
622
621
@@ -1428,58 +1427,58 @@ The following diagram illustrates this flow.
1428
1427
1429
1428
```java
1430
1429
public class PaymentProcessingWorkflow implements Workflow {
0 commit comments