React to events from a Total.js app
Print every order that a Total.js app publishes, and send a status back.
In this recipe a Total.js app publishes an orders_create event for each new order and accepts an orders_status event. FlowOS prints each new order and can send a status back. Use the names of your own app's events.
Connect the app
Add the app as a TMS source with its TMS endpoint and token. See Connect apps with TMS. Its events appear on the left: orders_create under Subscribe and orders_status under Publish.
Print each new order
- Drag
orders_createfrom Subscribe onto the canvas. - Drag Print onto the canvas.
- Connect the Output of
orders_createto the Input of Print. - Select APPLY and confirm.
When the app publishes an order, Print shows it.

Send a status back
- Drag
orders_statusfrom Publish onto the canvas. - Connect a node that produces the status, for example a Trigger that sends an object, to the Input of
orders_status. - Select APPLY and confirm.
Each message that reaches orders_status is sent to the app as that event.