Course Overview
This course is a tutorial for the Twinit Workflow Service: the back-end engine that runs long-running, stateful, multi-step processes and coordinates Twinit services with external systems.
The course works through a small weather data pipeline and uses it to introduce each concept and task type. You will create, run, and inspect every sample workflow in your own project.
Who this course is for#
Developers who have completed the Self-Led Developer training on
Twinit Academy and can run scripts from the Twinit IDE Extension. You should already understand Twinit projects, scripts, NamedUserCollections, NamedTelemetryCollections and the Item Service. No prior Workflow Service knowledge is assumed.
What you will be able to do#
By the end you will be able to:
- Explain the difference between a WorkflowDef (blueprint) and a Workflow (a single run), and describe a run's lifecycle.
- Read and write each of the nine built-in task types.
- Pass data between tasks using expression bindings
(
${task._output.field},${workflow.input.param},$.var). - Recognise which built-in task implements which enterprise integration pattern (router, splitter/aggregator, enricher, poller, and so on).
- Start workflows manually, on a schedule, or from an event.
- Monitor runs and debug failures at the task level.
The running example#
The example models a company with two sites (New York and San Francisco). A set of workflows fetches forecast data, stores it as telemetry readings, routes weather alerts by severity, enriches and transforms the data, polls for changes, asks a human for approval, and consults an AI forecasting team.
To keep the course self-contained and free of external API keys, the fetch steps return static forecast data instead of calling a live weather API. The mechanics of every task type are identical to a production workflow, only the data source is stubbed. The one place a real external dependency appears is the AI_CONVERSE lesson, which needs an OpenAI key.
How to work through the course#
Read the lessons in order; each builds on the previous one.
| # | Lesson | Task type / concept introduced |
|---|---|---|
| 01 | What is the Workflow Service? | Execution model, WorkflowDef vs Workflow, triggers |
| 02 | Provisioning the course project | Deploying the template package |
| 03 | Your first workflows: create and run | createAllWeatherWorkflows, SCRIPT_EXECUTION, running and polling |
| 04 | Tasks, task I/O, and expression bindings | Task anatomy, ${...} bindings, retries, timeouts |
| 05 | Parallelism with FORK_JOIN | FORK_JOIN |
| 06 | Content-based routing with SWITCH | SWITCH |
| 07 | Enricher and Splitter–Aggregator | Composed FORK_JOIN + SCRIPT_EXECUTION |
| 08 | Polling loops with DO_WHILE | DO_WHILE |
| 09 | Message transformation | SCRIPT_EXECUTION as translator |
| 10 | Human-in-the-loop with USER_INPUT | USER_INPUT |
| 11 | Calling an AI team with AI_CONVERSE | AI_CONVERSE (needs OpenAI key) |
| 12 | Monitoring, results, and debugging | Status, results, task-level logs |
| 13 | Triggers, scheduling, and EIP | Cron, events, pattern reference |
Prerequisites checklist#
- Completed the 2 | Self-Led Developer Basics course
- Completed the 3 | Self-Led Developer Intermediate course
- A working understanding of APIs and REST APIs, including how they work and how to use them
- A working understanding and ability to read asynchronous JavaScript code
- A working understanding and ability to read ES Modules
- A working understanding and ability to read JSON