Log every offboarding to Slack, Sheets, and your audit trail
The moment someone loses access in a customer's corporate directory, the removal is announced, logged to a spreadsheet, and written into their compliance record.
Run this as a webhook workflow. WorkOS should call it whenever Directory Sync reports that a user has been deactivated or removed from a customer's corporate directory: the dsync.user.deleted event, and dsync.user.updated when the user's state changes to inactive or suspended. Every delivery represents exactly one offboarding to record.
From the webhook payload, pull five values and reuse them everywhere downstream: the event timestamp (this is the date), the directory user's primary email address, the WorkOS organization id the directory belongs to, the directory id the change came from, and the event type. Do not summarize, score, enrich, or interpret anything. Every step below is a fixed field mapping.
First, use Slack Send a Message to post to our IT security channel. The message states that a directory user was deprovisioned and lists the user's email address, the organization, the directory the change came from, the event type, and when it happened. Use the same message format on every run.
Second, use Google Sheets Append Values to add one row to our running deprovisioning log. The columns are fixed and always in this order: date, email, organization, directory, event type. Append only, never overwrite, and never add, reorder, or rename columns between runs so the sheet stays sortable and auditable.
Third, use WorkOS Create an Audit Log Event to write the removal into the customer's own audit trail. Set organization_id to the organization from the payload, use a single consistent action name such as user.deprovisioned on every run, map the directory user as the actor and the same user plus the directory as the targets, and set occurred_at from the event timestamp.
WorkOS can redeliver a webhook, and a double-logged termination inside a compliance record is a real problem. Send an Idempotency-Key request header on the audit log write, set to the WorkOS event id, so a repeated delivery does not create a second entry.
Keep this fully deterministic: no branching, no reasoning step, no optional fields, no judgement calls. If a value is missing from the payload, write an empty cell rather than guessing, and still post to Slack and still write the audit log event.
What does this prompt do?
- Watches your identity system for the moment a person is deactivated or removed from a customer's corporate directory
- Posts the details to your IT security channel right away: who was removed, which customer, and which directory the change came from
- Adds a matching row to a running offboarding log, with the same five columns in the same order every single time
- Writes the removal into the customer's own compliance record, so their audit trail shows exactly when access ended
What do I need to use this?
- A WorkOS account with directory sync connected for at least one customer organization
- A Slack workspace, plus the channel your IT security team actually watches
- A Google account and a spreadsheet set aside for the offboarding log
- A tab in that spreadsheet with five columns: date, email, organization, directory, event type
How can I customize it?
- Change which Slack channel gets the alert, or route it to a private security channel instead of a shared one
- Point the log at a different spreadsheet or tab, or add extra columns such as manager or department
- Decide whether both deactivations and deletions count as offboarding, or only full removals
FAQs
What counts as someone being removed?
Does this actually revoke the person's access?
Will the same removal ever get logged twice?
Can I use a spreadsheet I already have?
Do I need to be a developer to set this up?
Related templates
When your flight moves, your calendar times get corrected automatically and you get a Slack note naming the meetings you're about to miss.
Every 15 minutes, forwarded phishing reports get traced back to the server that really sent them, with a verdict in Slack and the worst senders reported.
Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.
Every weekday at 7am, sign in to the tender portals you track, filter new notices against your bid criteria, and open a deal for the ones worth chasing.
Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.
Every Monday, rank the week's matches by expected demand, put the big ones on your venue calendar, and post a rota-ready summary to Slack.
Stop scrambling for offboarding evidence at audit time.
Every removal from a customer directory records itself in Slack, in your log, and in their compliance record the moment it happens.