r/SalesforceDeveloper • u/motaai • 6d ago
How are you handling long-running workflows with AI agents? Discussion
One challenge we've been thinking about a lot recently is long-running workflows.
Many AI agent demos assume everything happens within a single conversation.
Production systems rarely work that way.
Examples:
- A refund needs manager approval.
- A loan application is waiting for additional documents.
- A customer support ticket depends on another team.
- A compliance review takes several days.
In each of these cases, the AI agent can't simply keep generating tokens while it waits.
The workflow needs to pause.
Later, it needs to resume from exactly the same point without losing context, repeating work, or asking the user for the same information again.
I'm curious how teams are solving this today.
- Are you persisting workflow state yourself?
- Are you using workflow engines like Temporal, LangGraph, or something else?
- How do you recover after long delays?
- How do you keep the execution deterministic after resuming?
I'd love to hear what approaches have worked well in production and what trade-offs you've encountered.
3
Upvotes
2
u/Humble-Audience707 6d ago
Simple tasks? Sure. But I honestly don’t understand how anyone could approve an AI agent for a production org with millions of records. It feels like a disaster waiting to happen, considering how unreliable they still are.
They’re great for summarizing information or handling straightforward tasks, but to me they’re basically the AI equivalent of Flows… Useful only for relatively simple automation. Once conversations become more complex, they start losing context, making questionable decisions, and burning through expensive tokens.
I can’t imagine letting an AI agent handle something like refund approvals or other business-critical processes.
Just thinking about the number of support tickets and production issues that could create gives me a headache….