Salesforce Decode
Salesforcedecode
Back to questions
AgentforceAdvancedasyncplatform-eventsorchestrationreliability

Handle long-running and asynchronous workflows initiated by agents

Real World Scenario

Customers ask the agent to process warranty replacements requiring warehouse verification and shipping label generation—a process taking 10–30 minutes. Chat sessions cannot stay open waiting.

Expected Answer

• Acknowledge request synchronously, create a case/work order record, and return tracking reference to customer • Offload long steps to Queueable Apex, Flow orchestration, or MuleSoft with status polling endpoints • Use Platform Events or CDC to notify the customer via SMS/email when async work completes • Design idempotent workflow starters so duplicate agent invocations do not create double shipments • Expose status-check agent action reading case milestones—not re-running the whole workflow • Set customer expectations on timing in the initial agent response • Monitor stuck jobs with alerting on SLA breaches for async processes

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Direct answer: Acknowledge request synchronously, create a case/work order record, and return tracking reference to customer Also consider: Offload long steps to Queueable Apex, Flow orchestration, or MuleSoft with status polling endpoints In practice: Use Platform Events or CDC to notify the customer via SMS/email when async work completes Optimize for scale and operational observability.

Architect Perspective

Agents should initiate durable workflows, not embody them. Pattern: commit intent to database, async execute, notify on completion. This mirrors good microservice design—short synchronous boundary, long async tail.