Skip to content

Jobs.QueryPage

go
func (jobClient) QueryPage(
    ctx context.Context,
    options ...job.QueryOption,
) (*workflows.JobPage, error)

Query a single page of jobs matching the provided options.

Use QueryPage when you need manual pagination. Use Jobs.Query for automatic lazy pagination.

Parameters

options []job.QueryOption

Options for querying jobs.

Options

job.WithTemporalExtent(temporalExtent query.TemporalExtent)

Filter jobs by time or job ID interval.

job.WithAutomationIDs(automationIDs ...uuid.UUID)

Filter jobs by the automations that submitted them.

job.WithJobStates(states ...job.State)

Filter jobs by job state.

job.WithTaskStates(states ...job.TaskState)

Filter jobs by task state. Only jobs with at least one task in any of the given states are returned.

job.WithJobName(name string)

Filter jobs by name.

job.WithWorkflowReferences(references ...string)

Filter by remote workflow references. A job matches if any task is scoped to any selected workflow, regardless of that task’s state. Unscoped tasks do not match. Omission or an empty selection adds no workflow restriction. Preserve this filter when requesting subsequent pages.

job.WithCursor(cursor *job.Cursor)

Start the query after the cursor returned by a previous page.

job.WithLimit(limit int64)

Limit the number of jobs returned in this page.

job.WithSortDirection(direction job.SortDirection)

Sort jobs by submission date. Use job.Ascending for oldest first or job.Descending for newest first.

Returns

A JobPage with jobs and an optional NextCursor for the next page.

Type to search…