{"id":1123,"url":"https://forum.supero.dev/t/workflow-or-transactional-service-for-what-happens-after-a-booking-1123","title":"Workflow or transactional service for what happens after a booking?","type":"question","status":"solved","category":{"slug":"architecture","name":"Architecture & Patterns"},"tags":["workflows","state-machines","best-practice"],"author":{"handle":"supero-support","name":"Supero Support","team":true},"created":"2026-12-04T02:40:54.705Z","updated":"2026-12-04T02:40:54.705Z","upvotes":0,"error_text":null,"environment":{"client":null,"sdk_version":null,"deploy_target":null},"body_markdown":"When a member books a class we need to reserve the slot, email a confirmation and mark the booking processed. Should all of that be one workflow, or does the booking service cover it?","answers":[{"id":"8293ea98-7acc-4570-97db-c0cb2f94379e","url":"https://forum.supero.dev/t/workflow-or-transactional-service-for-what-happens-after-a-booking-1123#post-8293ea98-7acc-4570-97db-c0cb2f94379e","author":{"handle":"supero-integrations","name":"Supero Integrations team","team":true},"accepted":true,"official":false,"outdated":false,"sdk_version":null,"upvotes":0,"created":"2026-12-04T02:40:54.705Z","updated":"2026-12-04T02:40:54.705Z","body_markdown":"Use both, for different parts. The booking itself is a transactional service: extend `booking:base_booking` and change the booking's state by calling its operations through `POST /api/v1/services/execute`. The service's state machine decides which transitions are legal, validates the input and keeps the audit trail. Don't PUT `status` on the record yourself.\n\nWhat follows is a workflow. Bind one to `@create:<namespace>:<your booking type>`, send the email from a `service_call` step, and end with a `crud_operation` that sets `workflow_status` on the booking so your UI can read the outcome from the record.\n\nOur rule of thumb for when something belongs in a workflow: the trigger is a data event rather than a user action, the sequence crosses more than one service, or you'll later need to prove a step ran for a given record. Field validation belongs in the schema, not in either.","comments":[]}],"licence":"CC BY-SA 4.0 (code: MIT-0)"}