Skip to main content
Actions can call third-party APIs, use process.env, run for up to 10 minutes, and orchestrate other Convex functions. They’re not transactional — for atomicity, do data writes inside mutations called from the action.

Anatomy

convex/notifications.ts

ctx.run* helpers

Inside an action, call other Convex functions:

On the client

When to pick action vs mutation

Limits

  • 10-minute runtime per invocation.
  • Not transactional: a failure mid-action leaves the world in whatever partial state was reached.
  • No reactive subscriptions — clients call actions, but actions don’t push back.

Tips

Wrap third-party calls in try/catch. External APIs fail; handle the failure gracefully.
For idempotency, store a key in the DB. Before calling Stripe / Resend / etc., check whether you’ve already done this work.

Mutations

For DB writes called from actions.

Queries

For DB reads called from actions.

Background jobs

Long-running patterns.
Last modified on April 18, 2026