diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-workflow.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-workflow.md index ea29f97e9..ef26dbdce 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-workflow.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-workflow.md @@ -1,6 +1,6 @@ --- type: docs -title: "How to: Run a workflow" +title: "How to: Register and run a workflow" linkTitle: "How to: Run workflows" weight: 2000 description: Integrate, manage, and expose workflows @@ -9,37 +9,31 @@ description: Integrate, manage, and expose workflows Now that you've read about [the workflow building block]({{< ref workflow-overview >}}) and created your worfklow component, learn more about how to: - Use the built-in worfklow component -- Register an external workflow engine with Dapr. +- Register an external workflow component with Dapr. -Currently, Dapr supports two external workflow engines: -- Temporal.io -- Logic Apps +## Built-in workflow vs external workflows + +When you run `dapr init`, Dapr creates a default built-in workflow component. This component is written in Go and implements workflow instances as actors to promote placement and scalability. [Insert diagram] -## Run your workflow +Currently, Dapr supports two external workflow components in addition to the Dapr's built-in workflow component: +- Temporal.io +- Azure Logic Apps + +You can write your Temporal.io or Logic Apps worfklow instances and register them with the Dapr sidecar with all the features of the Dapr workflow API. + +## Register your workflow {{< tabs "Built-in" Temporal.io "Azure Logic Apps" >}} - - -{{% codetab %}} - -Develop your workflow. In the following example, - -```go -insert code snippet -``` - -{{% /codetab %}} - {{% codetab %}} Follow the [instructions provided by Temporal.io](https://docs.temporal.io/application-development/foundations#develop-workflows) to develop your workflow code. -For external workfow engines, there's an additional step to make sure workers for that engine are up and running. Once you've written your workflow, register the workflow with Dapr: +For external workfow components, there's an additional step to make sure workers for that component are up and running. Once you've written your workflow, register the workflow with Dapr: ```bash command? @@ -53,7 +47,7 @@ command? Follow the [instructions provided by Azure Logic Apps](https://docs.temporal.io/application-development/foundations#develop-workflows) to develop your workflow code. -For external workfow engines, there's an additional step to make sure workers for that engine are up and running. Once you've written your workflow, register the workflow with Dapr: +For external workfow components, there's an additional step to make sure workers for that component are up and running. Once you've written your workflow, register the workflow with Dapr: ```bash command? @@ -61,8 +55,44 @@ command? {{% /codetab %}} + + +{{% codetab %}} + +`dapr init` configures the built-in workflow component. No need to manually register the built-in workflow component. + +{{% /codetab %}} + + {{< /tabs >}} +## Run your workflow + +Next, run your workflow using the following API methods. For more information, read the [workflow API reference](). + +### Start + +To start your workflow, run: + +```bash +POST http://localhost:3500/v1.0/workflows/{workflowType}/{instanceId}/start +``` + +### Terminate + +To terminate your workflow, run: + +```bash +POST http://localhost:3500/v1.0/workflows/{workflowType}/{instanceId}/terminate +``` + +### Get metadata + +To fetch workflow outputs and inputs, run: + +```bash +GET http://localhost:3500/v1.0/workflows/{workflowType}/{instanceId} +``` ## Next steps diff --git a/daprdocs/content/en/reference/api/workflow_api.md b/daprdocs/content/en/reference/api/workflow_api.md index 95da3023f..bbe1d057d 100644 --- a/daprdocs/content/en/reference/api/workflow_api.md +++ b/daprdocs/content/en/reference/api/workflow_api.md @@ -66,7 +66,7 @@ If an instance already exists, the exact behavior is determined by policy. For e ## Terminate Workflow -Typically, service operators terminate a workflow if: +Typically, you'd terminate a workflow if: - A particular business process needs to be cancelled, or - The workflow encounters a problem and needs to be stopped for mitigation.