---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/jobs](../index.md) / runSystemJob

# Function: runSystemJob()

> **runSystemJob**(`instance`, `spec`): `Promise`\<\{ \}\>

Defined in: [packages/b2c-tooling-sdk/src/operations/jobs/run-system-job.ts:109](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/operations/jobs/run-system-job.ts#L109)

Starts a system job (waiting for completion unless `spec.wait === false`)
and returns the raw OCAPI [JobExecution](../type-aliases/JobExecution.md). Throws [JobExecutionError](../../../errors/classes/JobExecutionError.md)
(raw) when the job fails, or [OcapiDeprecatedError](../../../clients/classes/OcapiDeprecatedError.md) when the only
reachable backend is a deprecated OCAPI.

## Parameters

### instance

[`B2CInstance`](../../../instance/classes/B2CInstance.md)

### spec

[`SystemJobSpec`](../interfaces/SystemJobSpec.md)

## Returns

`Promise`\<\{ \}\>
