mirror of https://github.com/dapr/docs.git
some edits
Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
This commit is contained in:
parent
79eda64b5f
commit
d541960672
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
type: docs
|
type: docs
|
||||||
title: "How to: Run a workflow"
|
title: "How to: Register and run a workflow"
|
||||||
linkTitle: "How to: Run workflows"
|
linkTitle: "How to: Run workflows"
|
||||||
weight: 2000
|
weight: 2000
|
||||||
description: Integrate, manage, and expose workflows
|
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:
|
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
|
- 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:
|
## Built-in workflow vs external workflows
|
||||||
- Temporal.io
|
|
||||||
- Logic Apps
|
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]
|
[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" >}}
|
{{< tabs "Built-in" Temporal.io "Azure Logic Apps" >}}
|
||||||
|
|
||||||
<!-- built in -->
|
|
||||||
|
|
||||||
{{% codetab %}}
|
|
||||||
|
|
||||||
Develop your workflow. In the following example,
|
|
||||||
|
|
||||||
```go
|
|
||||||
insert code snippet
|
|
||||||
```
|
|
||||||
|
|
||||||
{{% /codetab %}}
|
|
||||||
|
|
||||||
<!-- temporal.io -->
|
<!-- temporal.io -->
|
||||||
|
|
||||||
{{% codetab %}}
|
{{% codetab %}}
|
||||||
|
|
||||||
Follow the [instructions provided by Temporal.io](https://docs.temporal.io/application-development/foundations#develop-workflows) to develop your workflow code.
|
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
|
```bash
|
||||||
command?
|
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.
|
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
|
```bash
|
||||||
command?
|
command?
|
||||||
|
@ -61,8 +55,44 @@ command?
|
||||||
|
|
||||||
{{% /codetab %}}
|
{{% /codetab %}}
|
||||||
|
|
||||||
|
<!-- built in -->
|
||||||
|
|
||||||
|
{{% codetab %}}
|
||||||
|
|
||||||
|
`dapr init` configures the built-in workflow component. No need to manually register the built-in workflow component.
|
||||||
|
|
||||||
|
{{% /codetab %}}
|
||||||
|
|
||||||
|
|
||||||
{{< /tabs >}}
|
{{< /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
|
## Next steps
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ If an instance already exists, the exact behavior is determined by policy. For e
|
||||||
|
|
||||||
## Terminate Workflow
|
## 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
|
- A particular business process needs to be cancelled, or
|
||||||
- The workflow encounters a problem and needs to be stopped for mitigation.
|
- The workflow encounters a problem and needs to be stopped for mitigation.
|
||||||
|
|
Loading…
Reference in New Issue