How to Automate Customer Onboarding in Slack With AI: The Model Proposes, a Human Approves
How to automate customer onboarding in Slack with AI: a state machine owns the checklist, Bedrock proposes changes, code checks them, a human approves.
Key takeaways
- Store the onboarding checklist as a typed state machine in a database, not in Slack messages or reactions.
- The LLM only proposes structured changes that cite a Slack message; code validates them and a CSM in the right Okta group approves.
- Keep secrets out of the channel by design, then scan every message with Bedrock Guardrails plus your own regex and entropy checks before the model sees it.
Slack is where onboarding gets discussed. It's a terrible place to keep the checklist.
A health-system go-live runs for weeks: BAA, security questionnaire, a slot in the interface team's queue, FHIR endpoints, CDS Hooks service registration, go-live. Most of those weeks are spent waiting on someone else. When the plan lives in channel history, nobody can say which step is stuck or whose move it is. Someone said "soon" in a thread nine days ago, and that's the only record.
My fix is simple. Keep the checklist in a database as a typed state machine. Let an LLM read the shared channel and propose changes. Code checks every proposal, and a human approves it.
The onboardings that gave us the most trouble were at a client outside healthcare, whose customers needed custom performance marketing funnels with A/B testing. We've wired Bedrock, Claude Opus, Okta and Slack into the tools their teams use to onboard customers, with Okta-gated approvals. The proposal schema, checks, queues and Step Functions below are the design I'd put around that. The running example is a health-system go-live for MedHook or eSpiral.
How the AI onboarding bot works
Here's the whole path from a Slack message to a changed row:
The model reads. Code decides what's even possible. A person decides what's true.
Store the onboarding checklist as a state machine, not in Slack
In my L2 support loop, state lives in Slack reactions: 👀 means claimed, ✅ means done. That works for one operator draining one queue. Onboarding breaks it. Steps have owners on both sides, dependencies, and due dates that slip, and the whole thing runs for weeks across many people. An emoji can't tell you whether the security questionnaire is what's blocking FHIR endpoint setup.
So the checklist is a table, with one row per step per customer:
step_id,customer_id,nameowner: which side, which roledepends_on: step IDs that must be done firstdue_datestatus:not_started,in_progress,blocked,donestatus_changed_at
Transitions live in code. A step can't move to done while a prerequisite is open. A step can't move to blocked without a blocker record that points at the message that raised it.
"Which steps have had no status change for seven days, across every customer?" is one query. Try answering that from channel history.
Slack Events API on Lambda: handling the 3-second timeout
Each customer gets their own Slack Connect channel, so the channel ID is the customer key. Events hit API Gateway and a Lambda that does three things: verify the signature, enqueue, return 200.
Slack expects a 2xx within three seconds. An inline Bedrock call or guardrail check is how you blow that budget, so the Lambda does no thinking at all.
import base64, hashlib, hmac, json, os, time
import boto3
sqs = boto3.client("sqs")
QUEUE_URL = os.environ["QUEUE_URL"] # a .fifo queue
SIGNING_SECRET = os.environ["SLACK_SIGNING_SECRET"].encode()
def handler(event, _ctx):
h = {k.lower(): v for k, v in event["headers"].items()}
body = event["body"]
if event.get("isBase64Encoded"):
body = base64.b64decode(body).decode() # raw bytes, never re-serialized JSON
ts = h.get("x-slack-request-timestamp", "0")
if abs(time.time() - int(ts)) > 300:
return {"statusCode": 401}
expected = "v0=" + hmac.new(SIGNING_SECRET, f"v0:{ts}:{body}".encode(),
hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, h.get("x-slack-signature", "")):
return {"statusCode": 401}
payload = json.loads(body)
if payload.get("type") == "url_verification":
return {"statusCode": 200, "body": payload["challenge"]}
sqs.send_message(QueueUrl=QUEUE_URL, MessageBody=body,
MessageGroupId=payload["event"]["channel"],
MessageDeduplicationId=payload["event_id"])
return {"statusCode": 200}
The signature is HMAC-SHA256 over v0:{timestamp}:{raw body}, keyed with your signing secret. Hash the body exactly as it arrived. Parsing and re-dumping the JSON first will break the match. Grouping messages by channel keeps each customer's messages in order.
Retries and idempotency
When delivery fails, Slack retries three times with an x-slack-retry-num header, and those retries count against your failure limits. Your worker will see the same event more than once. Plan for it.
An SQS FIFO queue drops repeated deduplication IDs inside a five-minute window, so using event_id absorbs most retries. Slack backs off between attempts, so don't assume every retry lands inside that window. The worker also does a conditional write keyed on event_id in DynamoDB before it processes anything. Two layers, because the queue alone won't catch a late retry.
Waits and approvals in Step Functions
Anything that waits goes in Step Functions. Reminders are Wait states. Approvals use .waitForTaskToken, which parks the workflow until something calls SendTaskSuccess with the token. That something is a button click.
Bedrock Converse tool use for structured onboarding updates
A worker pulls new messages for a channel and calls Bedrock's Converse API. The model sees the new messages plus that customer's open steps. Nothing else. It can only answer by calling one tool.
tool = {"toolSpec": {
"name": "propose_change",
"description": "Propose one checklist change grounded in one message.",
"inputSchema": {"json": {"type": "object", "properties": {
"kind": {"enum": ["step_done", "new_blocker", "date_moved", "open_question"]},
"step_id": {"type": "string"},
"new_due_date": {"type": "string", "format": "date"},
"summary": {"type": "string"},
"source_ts": {"type": "string"}},
"required": ["kind", "summary", "source_ts"]}}}}
resp = bedrock.converse(modelId=MODEL_ID, messages=msgs, toolConfig={
"tools": [tool], "toolChoice": {"tool": {"name": "propose_change"}}})
The narrow schema doesn't stop wrong answers. The model can still pick the wrong step_id, cite the wrong message, or invent a date. What the schema does is make those errors checkable, which is the next section.
Look at source_ts. The model returns the Slack timestamp of the message it's citing, and code turns that into a link with chat.getPermalink. Don't ask the model for URLs. Eventually it will make one up, and a proposal that cites a message nobody wrote is worse than no proposal.
Converse gives every model the same request shape, which is why the model is a config value. But tool use and forced tool choice vary by model. Many newer models are called through cross-region inference profile IDs rather than bare model IDs, and availability differs by region. "Swap Claude for Nova by changing one string" only holds among tool-capable models in your region. We use Claude Opus. Let your eval set pick yours, not a leaderboard. If you don't have one yet, build a small LLM eval set first.
Human approval with Block Kit buttons and Okta
Every proposal goes through deterministic checks before a human sees it.
def check(p, steps, author_role):
kind, step = p["kind"], steps.get(p.get("step_id"))
if kind == "open_question":
return "ok"
if kind == "new_blocker" and step is None:
return "ask: which step does this block?"
if step is None:
return "drop: unknown step"
if kind == "date_moved" and not p.get("new_due_date"):
return "drop: date_moved without a date"
if kind == "step_done":
open_deps = [d for d in step.depends_on
if d not in steps or steps[d].status != "done"]
if open_deps:
return f"ask: prerequisites open {open_deps}"
if author_role != step.owner:
return "flag: author is not the step owner"
return "ok"
Unknown step: dropped. A blocker that names no step becomes a question, because a real blocker with a bad step_id is still worth a human's eyes. A moved date with no date: dropped. Prerequisites still open: the "done" becomes a question for the CSM. A dependency that points at a missing step counts as open, because a broken checklist shouldn't let anything close.
Author isn't the owner: flagged. If the health system's project manager says the interface work is finished, that's worth a look. It isn't a closed step until the step's owner confirms it.
Whatever survives goes to the CSM as a Block Kit card in an internal channel, never the shared one. The card shows the proposed change, the permalink, and Approve, Edit and Reject buttons. Clicks arrive as block_actions interaction payloads under the same three-second ack rule.
This is the part that runs at the client today: approvals and auth are gated by Okta. Anyone in the channel can see the button, so the click handler does three things before anything calls SendTaskSuccess:
- Verify the Slack signature. Same check as the events Lambda.
- Map the Slack user to Okta. A Slack user ID isn't an Okta identity. Resolve the clicker to their Okta user, then confirm they're in the group that owns approvals.
- Make a conditional update. Move the proposal from
pendingtoapprovedexactly once. A double click or a retried payload then does nothing.
When a step stalls, the model drafts the nudge: "Any update on the CDS Hooks discovery endpoint? Registration is waiting on it." The CSM decides whether to send it, edit it, or pick up the phone. The model never sends anything to the customer and never closes a step.
Detect secrets and PHI in Slack messages with Bedrock Guardrails
At the funnels client, only employees in specific Okta groups handle credentials, and that's set up before the customer starts iterating on their intake funnels. I haven't seen a customer paste one into a channel there. The design goal is that a secret never needs to pass through the conversation.
Build the tripwire anyway, in two layers, before any text reaches the model.
Layer one is Bedrock Guardrails. ApplyGuardrail runs a guardrail on raw text without invoking a model, so you can scan every message, including the ones you'd never send to an LLM. Sensitive information filters can block or mask. AWS_ACCESS_KEY and AWS_SECRET_KEY are built-in entity types. regexesConfig covers the rest: Slack xox tokens, FHIR client secrets, the health system's MRN format.
Layer two is your own code, because Guardrails detection is model-based. AWS's own examples show it reading context: it treats "40 years" as an age and skips names inside addresses. That's fine for PII. It isn't a guarantee for a secret. Add plain regexes and a Shannon entropy check on long tokens. The defaults in Yelp's detect-secrets, 4.5 for base64 and 3.0 for hex, are a reasonable place to start.
On a hit, the message never goes to the model. You store a redacted copy only, and the CSM gets an alert. Rotate the credential; the redaction is only cleanup. The same Guardrails docs recommend CloudWatch log data protection for sensitive data in logs, so turn it on for your Lambda log groups.
Bedrock is the default because it's on AWS's HIPAA eligible services list, covered under the AWS BAA. Confirm that the specific models and features you use, cross-region inference included, are in scope for your account. Covered isn't compliant. I wrote about that gap in Is Claude Code HIPAA Compliant? Also, the customer's half of a Slack Connect channel runs under their org's policies, not yours. PHI doesn't belong in that channel at all.
Customer onboarding metrics: time to first value, stalled steps, override rate
Three numbers.
Time to first value. Days from kickoff to the customer getting something real. In a health-system go-live, that's the first CDS card in production.
Stalled days per step. How long each step sits without a status change, summed across customers. Start with one rule: any step where status <> 'done' AND status_changed_at < now() - interval '7 days' lands on the CSM's list every morning. Then rank steps by total stalled days. If the worst one is a queue you don't control, like the interface team's, request that slot at kickoff, not in week three.
Override rate. How often the CSM edits or rejects a proposal. Every override becomes a regression case in the eval set: the messages, the checklist state, and the correct answer. A new model has to beat the current one on that set before it reads a customer channel.
Build the table before the model
If you build one thing this week, make it the checklist table and the stalled-steps query. That alone shows you which queue is eating your go-live, with no LLM involved. Add the model second, as a faster reader of the channel, and the override log third so you know when it's wrong.
Onboarding is where the two rhythms of B2B collide: your product ships on your schedule, and the go-live ships on theirs. No model will speed up their queue. A good system makes sure you never lose a week finding out you're stuck in it.
Questions people ask
How do I automate customer onboarding in Slack with AI?
Keep the onboarding checklist in a database as a typed state machine and let an LLM read the shared channel and propose changes through a tool schema. Code validates each proposal, and a CSM approves it with Block Kit buttons.
Should an AI bot mark onboarding steps done automatically?
No. The model only proposes a change. Code checks that the step exists, its prerequisites are done and the author owns it, and a person in the approving Okta group clicks approve. The model drafts nudges, and the CSM decides whether to send them.
How fast does a Slack bot have to respond to events?
Slack expects a 2xx within three seconds. Verify the signature, enqueue the event to SQS, return, and do the Bedrock work asynchronously. Slack retries failed deliveries three times, so dedup on event_id in a FIFO queue and add a conditional write in DynamoDB.
Is Amazon Bedrock HIPAA eligible for onboarding automation?
Bedrock is on AWS's HIPAA eligible services list and covered under the AWS BAA, but confirm that the specific models and features you use are in scope for your account. Covered isn't compliant, and PHI shouldn't land in a Slack Connect channel at all.