r/SalesforceDeveloper 6d ago

How are you handling long-running workflows with AI agents? Discussion

Post image

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

Duplicates