Building resilient and scalable web workflows using the Temporal framework.
stateset
namespace)stateset-returns-automation
)
The code shows how we connect to the Temporal cluster and execute the returnApprovedWorkflow
workflow by passing some initial arguments.
This worker is configured to pick up workflow tasks on thestateset-returns-automation
task queue and use the code in theactivities.js
file.
returnApprovedWorkflow
orchestrates the various steps when a return request is approved. It’s triggered by the Temporal Client, and it executes the following activities:
This workflow defines the sequence of steps to execute when a return is approved. The workflow is composed of activities which are executed by the temporal worker.
These activities are functions that do the actual work for the workflow. In this case they’re just logging the activity for the sake of example. In a production system, these functions would call our APIs to perform business logic
This diagram shows the different parts of the temporal framework and how they’re organized.