Outcomes
Confirm workflow safety controls.
Confirm observability and rollback options.
Launch with confidence.
Examples
Use these patterns while learning this chapter.
Example workflow
Payment failed recovery
Stripe reports a failed subscription payment and the tenant needs a polite retry sequence before suspension.
Conditions
- Invoice status equals unpaid
- Customer email exists
- Subscription plan is not free
Actions
- Notify billing admin
- Email customer with payment link
- Wait 3 days
- Check invoice status again
- Create follow-up task if still unpaid
Safety checks
- Tenant suspension is behind a human approval node
- Max one reminder email per day
- Dead letter if Stripe token refresh fails
Try it: Paste a sample payment_failed payload and verify the no-email branch catches missing customer email.
Example workflow
New employee onboarding
HR approves a new hire and the company wants consistent access, tasks, calendar invites, and manager notifications.
Conditions
- Employee email exists
- Department equals Engineering
- Start date is within 14 days
Actions
- Create user invitation
- Assign position-based role
- Create onboarding tasks
- Send calendar invite
- Notify hiring manager
Safety checks
- Role assignment requires approval
- Invitation email is rate limited
- Tasks are created from a template
Try it: Ask AI Copilot for "engineering hire onboarding" and compare its draft against this example before enabling.
Step 1
Verify permissions
Workflow actions must obey module permissions and object-level access.
What to do
- Confirm the workflow owner has the correct role.
- Check that sensitive actions require admin approval.
- Use least-privilege connector scopes.
Check before continuing
- AI tools and workflows call backend tools only.
- Tokens are never exposed to frontend code.
Step 2
Set limits and retries
Limits prevent runaway automations, duplicate emails, and expensive loops.
What to do
- Set max runs per hour/day.
- Set max emails and webhooks per run.
- Configure retry delay and max attempts.
Check before continuing
- Failures move to dead letter after retries.
- External calls have timeouts.
Step 3
Plan rollback
Every workflow should have a safe way to pause, disable, or revert.
What to do
- Save a version before activation.
- Keep dry-run payloads and validation reports.
- Document rollback owners.
Check before continuing
- Pause button is known to operators.
- Run history and audit logs are available.
Pro tips
- Launch one workflow at a time, then expand after observing real run history.
- Review workflow health weekly during the first month.
Avoid these mistakes
- Do not activate payment, role, or suspension flows without a human approval path.
- Do not skip customer-facing email previews.