Rewrite intro and add new overview image

Signed-off-by: Marc Duiker <marcduiker@users.noreply.github.com>
This commit is contained in:
Marc Duiker 2023-05-26 16:07:41 +02:00
parent 2b6c5804c5
commit 72bd4e272a
3 changed files with 58 additions and 15 deletions

View File

@ -14,7 +14,7 @@ For more information on how workflow state is managed, see the [workflow archite
## Workflows
Dapr Workflows are functions you write that define a series of steps or tasks to be executed in a particular order. The Dapr Workflow engine takes care of coordinating and managing the execution of the steps, including managing failures and retries. If the app hosting your workflows is scaled out across multiple machines, the workflow engine may also load balance the execution of workflows and their tasks across multiple machines.
Dapr Workflows are functions you write that define a series of tasks to be executed in a particular order. The Dapr Workflow engine takes care of scheduling and execution of the tasks, including managing failures and retries. If the app hosting your workflows is scaled out across multiple machines, the workflow engine may also load balance the execution of workflows and their tasks across multiple machines.
There are several different kinds of tasks that a workflow can schedule, including
- [Activities]({{< ref "workflow-features-concepts.md#workflow-activities" >}}) for executing custom logic
@ -24,7 +24,7 @@ There are several different kinds of tasks that a workflow can schedule, includi
### Workflow identity
Each workflow you define has a type name, and individual executions of a workflow have a unique _instance ID_. Workflow instance IDs can be generated by your app code, which is useful when workflows correspond to business entities like documents or jobs, or can be auto-generated UUIDs. A workflow's instance ID is useful for debugging and also for managing workflows using the [Workflow APIs]({{< ref workflow_api.md >}}).
Each workflow you define has a type name, and individual executions of a workflow require a unique _instance ID_. Workflow instance IDs can be generated by your app code, which is useful when workflows correspond to business entities like documents or jobs, or can be auto-generated UUIDs. A workflow's instance ID is useful for debugging and also for managing workflows using the [Workflow APIs]({{< ref workflow_api.md >}}).
Only one workflow instance with a given ID can exist at any given time. However, if a workflow instance completes or fails, its ID can be reused by a new workflow instance. Note, however, that the new workflow instance effectively replaces the old one in the configured state store.
@ -36,8 +36,8 @@ When a workflow "awaits" a scheduled task, it unloads itself from memory until t
When a workflow function is replayed, it runs again from the beginning. However, when it encounters a task that already completed, instead of scheduling that task again, the workflow engine:
1. Returns the result of the completed task to the workflow.
1. Continues execution until the next "await" point.
1. Returns the stored result of the completed task to the workflow.
1. Continues execution until the next "await" point.
This "replay" behavior continues until the workflow function completes or fails with an error.

View File

@ -10,32 +10,75 @@ description: "Overview of Dapr Workflow"
Dapr Workflow is currently in alpha.
{{% /alert %}}
Dapr Workflow makes orchestrating the logic required for messaging, state management, and failure handling across various microservices easier for developers. Dapr Workflow enables you to create long running, fault-tolerant, stateful applications. Prior to Dapr Workflow, you'd often need to build ad-hoc workflows in custom, complex code in order to achieve long running, fault-tolerant, stateful applications.
Dapr workflow makes it easy for developers to write business logic and integrations a reliable way. Since Dapr workflows are stateful, they support long running and fault-tolerant applications, ideal for orchestrating microservices. Dapr workflow works seamlessly with other Dapr building blocks, such as service invocation, pub/sub, state management, and bindings.
The durable, resilient Dapr Workflow capability:
- Offers a built-in workflow runtime for driving Dapr Workflow execution
- Provides SDKs for authoring workflows in code, using any language
- Provides HTTP and gRPC APIs for managing workflows (start, query, suspend/resume, terminate)
- Integrates with any other workflow runtime via workflow components
- Offers a built-in workflow runtime for driving Dapr Workflow execution.
- Provides SDKs for authoring workflows in code, using any language.
- Provides HTTP and gRPC APIs for managing workflows (start, query, suspend/resume, terminate).
- Integrates with any other workflow runtime via workflow components.
<img src="/images/workflow-overview/workflow-overview.png" width=800 alt="Diagram showing basics of Dapr Workflow">
Start a workflow using the Dapr HTTP API with the workflow name, HelloWorldWorkflow, and an instance ID of 12345:
```bash
POST http://localhost:3500/v1.0-alpha1/workflows/dapr/HelloWorldWorkflow/12345/start
```
This results in a response that contains the workflow instance ID:
```bash
HTTP/1.1 202 Accepted
{
"instance_id": "12345"
}
```
Retrieve the workflow status and results with the HTTP API:
```bash
GET http://localhost:3500/v1.0-alpha1/workflows/dapr/HelloWorldWorkflow/12345
```
This results in a response that contains the workflow metadata:
```bash
HTTP/1.1 202 Accepted
{
"WFInfo": {
"instance_id": "12345"
},
"start_time": "2023-05-26T13:21:09Z",
"metadata": {
"dapr.workflow.custom_status": "",
"dapr.workflow.input": "\"World\"",
"dapr.workflow.last_updated": "2023-05-26T13:21:10Z",
"dapr.workflow.name": "HelloWorldWorkflow",
"dapr.workflow.output": "\"Hello World\"",
"dapr.workflow.runtime_status": "COMPLETED"
}
}
```
Some example scenarios that Dapr Workflow can perform are:
- Order processing involving inventory management, payment systems, shipping, etc.
- Order processing involving orchestration between inventory management, payment systems, and shipping services.
- HR onboarding workflows coordinating tasks across multiple departments and participants.
- Orchestrating the roll-out of digital menu updates in a national restaurant chain.
- Image processing workflows involving API-based classification and storage.
## Features
### Workflows and activities
With Dapr Workflow, you can write activites and then compose those activities together into a workflow. Workflow activities are:
With Dapr Workflow, you can write activities and then orchestrate those activities in a workflow. Workflow activities are:
- The basic unit of work in a workflow
- The tasks that get orchestrated in the business process
- Used for calling other (Dapr) services, interacting with state stores, and pub/sub brokers.
[Learn more about workflow activities.]({{< ref "workflow-features-concepts.md##workflow-activities" >}})
@ -47,7 +90,7 @@ In addition to activities, you can write workflows to schedule other workflows a
### Timers and reminders
Same as Dapr actors, you can schedule reminder-like durable delays for any time range.
Same as Dapr actors, you can schedule reminder-like durable delays for any time range.
[Learn more about workflow timers]({{< ref "workflow-features-concepts.md#durable-timers" >}}) and [reminders]({{< ref "workflow-architecture.md#reminder-usage-and-execution-guarantees" >}})
@ -80,7 +123,7 @@ You can use the following SDKs to author a workflow.
| Language stack | Package |
| - | - |
| .NET | [Dapr.Workflow](https://www.nuget.org/profiles/dapr.io) |
| .NET | [Dapr.Workflow](https://www.nuget.org/packages/Dapr.Workflow) |
## Try out workflows

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 89 KiB