Font Size:
Ask Joget AI

Async Agent Execution

This article describes how Joget runs agent jobs in the background, and how administrators can tune throughput and polling behaviour.

Who this page is for
This is administrator and operator guidance. It covers server-side configuration that is not accessible from the Joget UI.

When an Agent Process Tool is configured with Run Mode = Async, Joget offloads the agent job to a background worker pool. The HTTP request or workflow thread that triggered the agent returns immediately; the job runs separately and stores its result when done.

Job lifecycle

Every async agent run passes through four states:

Status Meaning
PENDING Job is queued. No worker has claimed it yet.
RUNNING A worker thread has claimed the job and the agent is executing.
DONE Agent completed successfully. Any configured store-to-form or store-to-variable callbacks have run.
FAILED The agent or a callback threw an error.

How it works

  1. The Agent Process Tool writes the job to the database with status PENDING and returns to the caller immediately.
  2. A background poller detects PENDING jobs at a configurable interval and claims them atomically; only one worker ever processes a given job.
  3. The worker restores the original app and user context, runs the agent, then executes any output callbacks.
  4. The job record is updated to DONE or FAILED.

JVM tuning properties

These properties control how the background executor behaves. Both are read once at startup a server restart is required after changing them.

Property Default Description
agent.async.pollInterval 5 How often (in seconds) the executor queries the database for PENDING jobs. Increase to reduce DB polling load; decrease for lower job latency.
agent.async.workerThreads 4 Number of threads that execute agent jobs concurrently. Increase for higher throughput on servers with spare CPU and memory.

Setting these properties

Pass them as JVM system properties at server startup:

-Dagent.async.pollInterval=10
-Dagent.async.workerThreads=8

Tomcat (setenv.sh / setenv.bat):

JAVA_OPTS="$JAVA_OPTS -Dagent.async.pollInterval=10 -Dagent.async.workerThreads=8"

Choosing values
Start with the defaults. Increase workerThreads if agents are queuing up (many PENDING jobs). Increase pollInterval if database query load is a concern on shared infrastructure. There is no benefit to setting pollInterval below 1.

Cluster deployments

The async executor is cluster-safe. Job claiming uses an atomic database update, so only one node in a multi-node Joget cluster will ever pick up and run a given job, even when all nodes share the same database. No additional coordination is required.

Created by Debanraj Ravindran Last modified by Debanraj Ravindran on Sep 21, 2026