Exit Job
Use the Exit Job task to stop the whole job immediately.
When the Exit Job task runs, no further tasks are executed, regardless of where the Exit Job task is placed (including inside ForEach loops or If blocks).
| Option | Description |
|---|---|
| Fail the job | When selected, the job ends as failed. When cleared (the default), the job ends successfully. |
| Message | An optional message. Provide one when the
job is set to fail. When the job fails, the message is used as the failure
message. The message supports field variables, for example
{documentProperty:Region} or
{forEachProperty:Country}.
|
Note: An Exit Job specified to fail the job ends the job even when it
runs inside a ForEach that is configured to continue on error.
Examples
Stop the job with a failure message when a data table is empty:
Open Analysis from Library
If
result = AutomationContext.Application.Document.Data.Tables["Sales"].RowCount == 0
Exit Job
Fail the job: Yes
Message: "Sales table is empty — nothing to export."
End If
Export Data
Skip re-processing an already processed analysis without failing the job:
Open Analysis from Library
If
result = "{documentProperty:AlreadyProcessed}" == "True"
Exit Job
Fail the job: No
Message: "Analysis was already processed, skipping."
End If
Export Data