diff --git a/examples/workflow/README.md b/examples/workflow/README.md index e27f4c78..b1f1cfae 100644 --- a/examples/workflow/README.md +++ b/examples/workflow/README.md @@ -338,7 +338,7 @@ When you run the example, you will see output like this: ``` -### Cross-app Workflow +### Multi-app Workflows This example demonstrates how to call child workflows and activities in different apps. The multiple Dapr CLI instances can be started using the following commands: @@ -361,9 +361,9 @@ sleep: 20 --> ```sh -dapr run --app-id wfexample3 python3 cross-app3.py & -dapr run --app-id wfexample2 python3 cross-app2.py & -dapr run --app-id wfexample1 python3 cross-app1.py +dapr run --app-id wfexample3 python3 multi-app3.py & +dapr run --app-id wfexample2 python3 multi-app2.py & +dapr run --app-id wfexample1 python3 multi-app1.py ``` @@ -379,9 +379,9 @@ among others. This shows that the workflow calls are working as expected. #### Error handling on activity calls -This example demonstrates how the error handling works on activity calls across apps. +This example demonstrates how the error handling works on activity calls in multi-app workflows. -Error handling on activity calls across apps works as normal workflow activity calls. +Error handling on activity calls in multi-app workflows works as normal workflow activity calls. In this example we run `app3` in failing mode, which makes the activity call return error constantly. The activity call from `app2` will fail after the retry policy is exhausted. @@ -404,9 +404,9 @@ sleep: 20 ```sh export ERROR_ACTIVITY_MODE=true -dapr run --app-id wfexample3 python3 cross-app3.py & -dapr run --app-id wfexample2 python3 cross-app2.py & -dapr run --app-id wfexample1 python3 cross-app1.py +dapr run --app-id wfexample3 python3 multi-app3.py & +dapr run --app-id wfexample2 python3 multi-app2.py & +dapr run --app-id wfexample1 python3 multi-app1.py ``` @@ -424,9 +424,9 @@ among others. This shows that the activity calls are failing as expected, and th #### Error handling on workflow calls -This example demonstrates how the error handling works on workflow calls across apps. +This example demonstrates how the error handling works on workflow calls in multi-app workflows. -Error handling on workflow calls across apps works as normal workflow calls. +Error handling on workflow calls in multi-app workflows works as normal workflow calls. In this example we run `app2` in failing mode, which makes the workflow call return error constantly. The workflow call from `app1` will fail after the retry policy is exhausted. @@ -445,9 +445,9 @@ sleep: 20 ```sh export ERROR_WORKFLOW_MODE=true -dapr run --app-id wfexample3 python3 cross-app3.py & -dapr run --app-id wfexample2 python3 cross-app2.py & -dapr run --app-id wfexample1 python3 cross-app1.py +dapr run --app-id wfexample3 python3 multi-app3.py & +dapr run --app-id wfexample2 python3 multi-app2.py & +dapr run --app-id wfexample1 python3 multi-app1.py ``` diff --git a/examples/workflow/cross-app1.py b/examples/workflow/multi-app1.py similarity index 100% rename from examples/workflow/cross-app1.py rename to examples/workflow/multi-app1.py diff --git a/examples/workflow/cross-app2.py b/examples/workflow/multi-app2.py similarity index 100% rename from examples/workflow/cross-app2.py rename to examples/workflow/multi-app2.py diff --git a/examples/workflow/cross-app3.py b/examples/workflow/multi-app3.py similarity index 100% rename from examples/workflow/cross-app3.py rename to examples/workflow/multi-app3.py diff --git a/ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_context.py b/ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_context.py index cc0cfe8b..d90c72dc 100644 --- a/ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_context.py +++ b/ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_context.py @@ -68,12 +68,12 @@ def call_activity( retry_policy: Optional[RetryPolicy] = None, app_id: Optional[str] = None, ) -> task.Task[TOutput]: - # Handle string activity names for cross-app scenarios + # Handle string activity names for multi-app workflow scenarios if isinstance(activity, str): activity_name = activity if app_id is not None: self._logger.debug( - f'{self.instance_id}: Creating cross-app activity {activity_name} for app {app_id}' + f'{self.instance_id}: Creating multi-app workflow activity {activity_name} for app {app_id}' ) else: self._logger.debug(f'{self.instance_id}: Creating activity {activity_name}') @@ -106,7 +106,7 @@ def call_child_workflow( retry_policy: Optional[RetryPolicy] = None, app_id: Optional[str] = None, ) -> task.Task[TOutput]: - # Handle string workflow names for cross-app scenarios + # Handle string workflow names for multi-app workflow scenarios if isinstance(workflow, str): workflow_name = workflow self._logger.debug(f'{self.instance_id}: Creating child workflow {workflow_name}') diff --git a/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_context.py b/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_context.py index 8453e16e..d4184147 100644 --- a/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_context.py +++ b/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_context.py @@ -118,7 +118,7 @@ def call_activity( Parameters ---------- activity: Activity[TInput, TOutput] | str - A reference to the activity function to call, or a string name for cross-app activities. + A reference to the activity function to call, or a string name for multi-app workflow activities. input: TInput | None The JSON-serializable input (or None) to pass to the activity. app_id: str | None @@ -145,7 +145,7 @@ def call_child_workflow( Parameters ---------- orchestrator: Orchestrator[TInput, TOutput] | str - A reference to the orchestrator function to call, or a string name for cross-app workflows. + A reference to the orchestrator function to call, or a string name for multi-app workflows. input: TInput The optional JSON-serializable input to pass to the orchestrator function. instance_id: str