Fault Activity
Purpose: Faults the workflow. This activity throws a fault exception, causing the workflow to enter a faulted state with specified error information.
Input Properties
Code
Code to categorize the fault.
Type: string
Default: "0"
Required: Yes
Note: A numeric or alphanumeric code to identify the type of fault.
Category
Category to categorize the fault. Examples: HTTP, Alteration, Azure, etc.
Type: string
Default: "General"
Required: Yes
Type
The type of fault. Examples: System, Business, Integration, etc.
Type: string
Default: "System"
Required: Yes
Message
The message to include with the fault.
Type: string?
Required: No
Note: A descriptive message explaining the fault condition.
Output Properties
This activity has no output properties. It throws an exception instead.
Usage Example
Scenario: Fault workflow when validation fails Configuration: - Code: "VALIDATION_ERROR" - Category: "Business" - Type: "Validation" - Message: "Required field 'OrderId' is missing" Result: - Workflow enters faulted state - Fault exception is thrown with the specified details - Workflow execution stops - Error information is available in workflow logs and status
Important Notes
- Fault immediately stops workflow execution
- The workflow enters a Faulted state
- A FaultException is thrown with the specified details
- Fault information is logged and available in workflow status
- Use Fault for error handling and validation scenarios
- Different from Finish which cleanly terminates, Fault indicates an error condition
- Fault details (Code, Category, Type, Message) help with error diagnosis and handling