---
title: "Scheduler.Job"
slug: "schedulerjob"
updated: 2024-08-21T13:22:17Z
published: 2024-08-21T13:22:17Z
canonical: "support.lusid.com/schedulerjob"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.lusid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scheduler.Job

| **Type** | **Read/write** | **Author** | **Availability** |
| --- | --- | --- | --- |
| [Data provider](/v1/docs/what-are-a-data-provider-and-a-direct-provider) | Read | Finbourne | Provided with LUSID |

The `Scheduler.Job` provider enables you to write a [Luminesce SQL query](/v1/docs/understanding-the-luminesce-sql-query-syntax) that retrieves job data from [Scheduler](/v1/docs/scheduler).

> **Note:** The LUSID user running the query must have sufficient [access control permissions](/v1/docs/creating-policies-to-control-access-to-providers-for-different-luminesce-end-users) to both use the provider *and* read Scheduler job data. This should automatically be the case if you are the domain owner.

**See also:** [Scheduler.Job.History](/v1/docs/schedulerjobhistory), [Scheduler.Job.HistoryWithLogs](/v1/docs/schedulerjobhistorywithlogs), `Scheduler.Job.Run`

## Basic usage

```sql
select * from Scheduler.Job where <filter-expression>;
```

## Query parameters

`Scheduler.Job` has parameters that enable you to filter or refine a query.

To list available parameters, their data types, default values, and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Scheduler.Job' and FieldType = 'Parameter';
```

## Data fields

By default, `Scheduler.Job` returns a table of data populated with particular fields (columns). You can return a subset of these fields.

To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Scheduler.Job' and FieldType = 'Column';
```

> **Note:** Fields marked 'main' are returned by queries that include a caret character, for example `select ^ from Scheduler.Job`.

## Examples

> **Note:** For more example Luminesce SQL queries, visit our [Github repo](https://github.com/finbourne/luminesce-examples/tree/master/examples).

### Example 1: Retrieve first ten jobs

```sql
select * from Scheduler.Job limit 10
```

### Example 2: Retrieve information for a particular job

```sql
select * from Scheduler.Job where JobScope = 'transactions' and JobCode = 'upsert-transactions'
```

### Example 3: Retrieve jobs that execute a particular Docker image

```sql
select * from Scheduler.Job where DockerImage like '%lusid-upsert-transactions-image:%'
```

### Example 4: Retrieve all jobs created by a particular person

```sql
select * from Scheduler.Job where Author = 'Joe Bloggs'
```

### Example 5: Retrieve logs for all failed jobs in a job scope

In this example, `Scheduler.Job` is joined with [Scheduler.Job.HistoryWithLogs](/v1/docs/schedulerjobhistorywithlogs) to retrieve all console output logs for failed jobs within a particular scope.

```sql
select * 
from Scheduler.Job j
join Scheduler.Job.HistoryWithLogs h
  on j.JobScope = h.JobScope
  and j.JobCode = h.JobCode
where h.JobStatus = 'Failed'
and j.JobScope = 'transactions'
```
