Pikbase Docs
Open console (opens the console)
Esc

Type to search.

Logic and automation

Recurring jobs

Inspect scheduled workflows and functions, understand cron configuration, and verify actual execution.

Recurring jobs run either a workflow or a serverless function on a schedule managed by GSB. Use them for periodic work such as daily reports, scheduled notifications, or data synchronization. Execution takes place on the platform and does not depend on an open browser session.

Choose the target using workflow_id for a workflow or function_id for a serverless function. A serverless function can be scheduled directly without wrapping it in a workflow. See Workflows and Serverless functions for the two execution targets.

Execution targets

A GsbRecurringJob stores the cron expression and active state and references either of these execution targets:

Target Reference Purpose
Workflow workflow_id Run a workflow on the recurring schedule.
Serverless function function_id Run a serverless function directly on the recurring schedule, without a workflow wrapper.

Use a workflow for a process with multiple activities, decisions, or human tasks. Use a serverless function for a self-contained operation.

Schedule records

Each schedule is represented by a GsbRecurringJob record.

Field Meaning
id Schedule record identifier.
name, title Technical name and display title.
cronExpression Configured schedule expression.
isActive Whether the schedule is enabled.
workflow_id, workflow Referenced workflow.
function_id, function Referenced serverless function (GsbWfFunction). No workflow wrapper is required.
module_id, module Module reference.
createDate, createdBy_id, createdBy Record creation audit information.
lastUpdateDate, lastUpdatedBy_id, lastUpdatedBy Record modification audit information.

Select one execution target for each job: a workflow or a serverless function. Creation and modification timestamps describe the schedule record, not its execution history.

Read schedules

Read schedules with the Entity Service's query operation. The following example uses an initialized entityService, an authenticated token, and the workspace's tenantCode to retrieve up to 50 schedules.

import { QueryParams } from "@gsb-core/core";

const query = new QueryParams("GsbRecurringJob")
  .select([
    "id",
    "name",
    "title",
    "cronExpression",
    "isActive",
    "workflow_id",
    "function_id",
    "module_id",
  ])
  .skip(0)
  .take(50);

const schedules = await entityService.query(query, token, tenantCode);
if (!schedules.success) {
  throw new Error(schedules.message);
}

Increase the skip offset to retrieve subsequent pages. The caller must have permission to read GsbRecurringJob in the selected workspace. This query reads schedule configuration; it does not start a job.

Inspect in Workspace

Open System > Recurring jobs to view schedules and summary statistics, including total jobs, active jobs, and associated modules and workflows.

This screen is read-only. It does not provide controls to create, edit, enable, disable, delete, or manually run jobs. Refresh updates the statistics; it does not execute scheduled work. Contact your workspace administrator for schedule changes.

Summary statistics describe schedule records, not individual runs. Verify results through the business data the job updates or through monitoring you add to its implementation.

Cron expressions

The cronExpression field describes when a job runs. In five-field cron notation, the fields are:

minute hour day-of-month month day-of-week
Expression Five-field meaning
0 9 * * 1 Mondays at 09:00.
0 2 * * * Daily at 02:00.
*/15 * * * * Every 15 minutes.

These examples illustrate five-field notation. Before enabling a schedule, confirm the supported cron format and scheduler time zone with your workspace administrator, including how daylight-saving changes are handled. Do not interpret schedule times using the browser's local time zone.

Deployment and activation

Include recurring jobs in a resource pack using the recurringJobs asset family. When you provide an explicit moduleFields selection, include recurringJobs alongside the other resources needed by the release. See addResourcePack and CI/CD, deployment, and seeds.

Before releasing a schedule:

  1. Include the target workflow or serverless function and its dependencies in the release.
  2. Verify external-service configuration and permissions in the destination workspace.
  3. Check the installed schedule's target, cron expression, time zone, and active state.
  4. Verify a scheduled run in a non-production workspace before enabling production work.

Make scheduled operations idempotent: repeating an invocation should not duplicate a charge, notification, or other business action. For work that may outlast its scheduling interval, establish how overlapping runs are handled before activation.

Verify execution

Recurring jobs do not retain per-execution logs by default. This avoids excessive log volume from frequent schedules. A serverless function is part of your backend; scheduling it does not automatically log every call.

Choose monitoring that fits the operation:

  • Check the expected business result, such as an updated record or a completed report.
  • Add informational system logs inside the function for significant events or diagnostic details when needed.
  • Add application-specific execution checks or execution records when you need to track completion, detect missed work, or retain an audit trail.

Keep logging selective. For high-frequency jobs, prefer exceptions or periodic summaries over a log entry for every successful invocation. Define retention for any execution records you create, and exclude credentials and personal data from logs.

If an expected result is missing:

  1. Check that the schedule is active and references the intended target.
  2. Verify the cron expression and scheduler time zone.
  3. Check the target's dependencies, permissions, and business data. Review any diagnostic logs or execution checks you have added.
  4. Add targeted diagnostics if needed, or ask your workspace administrator to check the schedule's registration and scheduler status.

The absence of an execution log does not indicate a failed or missed run. When reporting a problem, include the job identifier, expected run time and time zone, and the missing business result, together with any diagnostic identifiers you have collected.

Contract sourcedocs/guides/recurring-jobs.md