# UTIL_AsyncChain.StepResult

**Class** · Group: `Async`

Learn it: [Fast Start - Async Processing](/fast-start-async-processing) and [Async Processing guide](/async-processing-guide)

<div class="apex-member apex-class">

```apex
global inherited sharing class UTIL_AsyncChain.StepResult
```

Immutable result object returned by each ChainStep to indicate success or failure. Use the static factory methods to create instances.

**Example**

```apex
UTIL_AsyncChain.StepResult result = UTIL_AsyncChain.succeeded('All records processed');
UTIL_AsyncChain.StepResult failure = UTIL_AsyncChain.failed('Missing required field');
```

</div>

---

## Properties

| Property | Description |
|----------|-------------|
| global [Object](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_Object.htm) [data](#data) | Optional payload data returned by the step. |
| global [Exception](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_exception_methods.htm) [error](#error) | The exception that caused the step to fail, if applicable. |
| global [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm) [message](#message) | Optional human-readable message describing the outcome. |
| global [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm) [permanentFailure](#permanentfailure) | True when the step declared this failure permanent: the failure will happen again on every try, so the chain refuses any retry whatever the configured retry budget, and records the failure with category StepException. |
| global [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm) [success](#success) | Whether the step completed successfully. |

### data

```apex
global Object data
```

**Type:** [Object](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_Object.htm)

Optional payload data returned by the step.

### error

```apex
global Exception error
```

**Type:** [Exception](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_exception_methods.htm)

The exception that caused the step to fail, if applicable.

### message

```apex
global String message
```

**Type:** [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm)

Optional human-readable message describing the outcome.

### permanentFailure

```apex
global Boolean permanentFailure
```

**Type:** [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm)

True when the step declared this failure permanent: the failure will happen
again on every try, so the chain refuses any retry whatever the configured retry
budget, and records the failure with category StepException. Never null: false on
every result except one built by failedPermanently().

### success

```apex
global Boolean success
```

**Type:** [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm)

Whether the step completed successfully.
