Skip to content

Step 4 of my flow fails, but steps 1 to 3 already wrote things to other systems

Workflows are not database transactions. If a later step fails the half-action stays in place and you get drift between systems. The pattern for this is compensating transactions.

Try this first

  1. 1Define a counterpart for each write step: contact-created gets a delete-contact, invoice-created a credit-note or cancel-status.
  2. 2Wrap all write steps in a try-block and on error: walk through the compensations in reverse order, not just for the last step.
  3. 3Store in a log record which step-ids already ran, otherwise the error handler can't tell what to undo.
  4. 4Idempotent compensations: a delete on an already-missing record must not fail, otherwise the rollback itself blocks.
  5. 5Test deliberately: inject a fake error in step 4 and check that steps 1 to 3 are clean. Only then can you trust the pattern.

When to bring us in

If your flows touch money or inventory without rollback, that is priority one. We can look at the concrete pattern.

See also

None of the above fits?

Describe your situation below. We pass your input plus the steps you already saw to our AI and return tailored next-step advice. If it's too risky to DIY, we'll say so.

Who are you?

For the AI question we need your email and company, so we can follow up if the AI gets stuck, and to prevent abuse.

Limited to 2 questions per hour and 5 per day, kept lean so the AI stays useful. For more, contacting us directly works better for you and us.

Or skip the DIY entirely

Our Managed IT clients do not look these things up. One point of contact, a fixed monthly price, resolved within working hours.