apoc.periodic

Global Job Registry and Privilege Considerations

The background job procedures (apoc.periodic.submit, apoc.periodic.repeat, apoc.periodic.countdown, apoc.periodic.cancel, and apoc.periodic.list) share a single, DBMS-wide registry keyed solely by the job name.

Jobs are not isolated by user or database, and APOC does not enforce job ownership:

  • apoc.periodic.list reveals the names and status of all background jobs across all databases to any caller.

  • apoc.periodic.cancel allows any caller to cancel any job given its name.

  • Scheduling a job with an existing name (via submit or repeat) cancels and replaces the existing job with the caller’s query.

If untrusted or non-administrative users have access to your DBMS, restrict execution of these procedures to authorized roles using Neo4j role-based access control (RBAC):

DENY EXECUTE PROCEDURE apoc.periodic.list ON DBMS TO `PUBLIC`;
DENY EXECUTE PROCEDURE apoc.periodic.cancel ON DBMS TO `PUBLIC`;
DENY EXECUTE PROCEDURE apoc.periodic.submit ON DBMS TO `PUBLIC`;
DENY EXECUTE PROCEDURE apoc.periodic.repeat ON DBMS TO `PUBLIC`;
DENY EXECUTE PROCEDURE apoc.periodic.countdown ON DBMS TO `PUBLIC`;

For complete details on managing procedure execution permissions, see the Operations Manual → Procedure and user-defined function privileges.

Qualified Name Type

apoc.periodic.cancel(name STRING) - cancels the given background job. Background jobs are created using apoc.periodic.submit.

Procedure

apoc.periodic.commit(statement STRING, params MAP<STRING, ANY>) - runs the given statement in separate batched transactions.

Procedure

apoc.periodic.countdown(name STRING, statement STRING, delay INTEGER) - runs a repeatedly called background statement until it returns 0.

Procedure

apoc.periodic.iterate(cypherIterate STRING, cypherAction STRING, config MAP<STRING, ANY>) - runs the second statement for each item returned by the first statement. This procedure returns the number of batches and the total number of processed rows.

Procedure Deprecated in Cypher 25

apoc.periodic.list() - returns a LIST<ANY> of all background jobs.

Procedure

apoc.periodic.repeat(name STRING, statement STRING, rate INTEGER, config MAP<STRING, ANY>) - runs a repeatedly called background job. To stop this procedure, use apoc.periodic.cancel.

Procedure

apoc.periodic.submit(name STRING, statement STRING, params MAP<STRING, ANY>) - creates a background job which runs the given Cypher statement once.

Procedure

apoc.periodic.truncate(config MAP<STRING, ANY>) - removes all entities (and optionally indexes and constraints) from the database using the apoc.periodic.iterate procedure.

Procedure Admin Only