Liberate Workflow Types
The Liberate platform offers different types of workflows to accommodate various use cases and execution requirements. This developer documentation provides an overview of the two main workflow types in Liberate: synchronous flows and asynchronous flows. Understanding the differences between these workflow types will help you choose the appropriate approach for your specific requirements.
Synchronous Flows
Synchronous flows in Liberate are designed to execute the entire workflow in a synchronous manner. When a synchronous flow is called, it immediately responds with a status code and instance ID. The workflow execution continues until it reaches the end, and the final output or data of the flow is returned as the response.
Key characteristics of synchronous flows include:
- Immediate response: When a synchronous flow is triggered, it promptly provides a response with the status code and instance ID.
- Sequential execution: Synchronous flows follow a sequential execution model, where each task or action is executed one after another in the defined order.
- End output as response: The final output or data generated by the flow is returned as the response once the entire workflow completes its execution.
Synchronous flows are suitable for scenarios where real-time processing and immediate results are required. They are typically used for workflows that do not involve long-running tasks or extensive human interaction.
Asynchronous Flows
Asynchronous flows, on the other hand, are designed to handle long-running tasks or processes that might require human intervention or significant time to complete. When an asynchronous flow is called, it also responds immediately with a status code and instance ID, indicating that the flow has been initiated.
Key characteristics of asynchronous flows include:
- Immediate response: Like synchronous flows, when an asysnc flow is triggered, it promptly provides a response with the status code and instance ID.
- Long-running tasks: Asynchronous flows are well-suited for workflows that involve long-running tasks, which may take minutes, hours, or even days to complete.
- Human interaction: These flows often involve steps where human input or decision-making is required, allowing for human-in-the-loop processes.
- Delayed response: Unlike synchronous flows, asynchronous flows do not provide an immediate response with the final output or data. Instead, the response indicates that the flow has been started and will be completed at a later time.
Asynchronous flows are commonly used for workflows that involve complex business processes, extensive data processing, or tasks that require human approval or intervention.
Updated 9 months ago
