func (*JobClient) Query( ctx context.Context, options ...job.QueryOption,) iter.Seq2[*workflows.Job, error]Query jobs matching the provided options.
The jobs are lazily loaded across pages and returned as a sequence of jobs. The output sequence can be transformed into a slice of Job using Collect function.
Parameters
Section titled “Parameters”options []job.QueryOption Options for querying jobs
Options
Section titled “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.WithJobName(name string) Filter jobs by name.
job.WithTaskStates(states ...job.TaskState) Filter jobs by the states of their tasks. Only jobs that have at least one task in any of the given states will be returned. Useful for finding jobs with optional task failures.
job.WithCursor(cursor *job.Cursor) Start the query after the cursor returned by a previous page.
job.WithLimit(limit int64) Limit the total number of jobs yielded by the sequence.
job.WithSortDirection(direction job.SortDirection) Sort jobs by submission date. Use job.Ascending for oldest first or job.Descending for newest first.
Returns
Section titled “Returns”A sequence of jobs.