Skip to main content

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.

#LessonTask type / concept introduced
01What is the Workflow Service?Execution model, WorkflowDef vs Workflow, triggers
02Provisioning the course projectDeploying the template package
03Your first workflows: create and runcreateAllWeatherWorkflows, SCRIPT_EXECUTION, running and polling
04Tasks, task I/O, and expression bindingsTask anatomy, ${...} bindings, retries, timeouts
05Parallelism with FORK_JOINFORK_JOIN
06Content-based routing with SWITCHSWITCH
07Enricher and Splitter–AggregatorComposed FORK_JOIN + SCRIPT_EXECUTION
08Polling loops with DO_WHILEDO_WHILE
09Message transformationSCRIPT_EXECUTION as translator
10Human-in-the-loop with USER_INPUTUSER_INPUT
11Calling an AI team with AI_CONVERSEAI_CONVERSE (needs OpenAI key)
12Monitoring, results, and debuggingStatus, results, task-level logs
13Triggers, scheduling, and EIPCron, events, pattern reference

Prerequisites checklist#

  1. Completed the 2 | Self-Led Developer Basics course
  2. Completed the 3 | Self-Led Developer Intermediate course
  3. A working understanding of APIs and REST APIs, including how they work and how to use them
  4. A working understanding and ability to read asynchronous JavaScript code
  5. A working understanding and ability to read ES Modules
  6. A working understanding and ability to read JSON