Success Activity
- Purpose: To define the workflow's behavior when execution is successful. This activity is executed when a workflow path is considered to have completed successfully.
- Functionality: The "Success Activity" is used to handle successful workflow completion. When a workflow execution reaches a "Success Activity", it signifies that the intended tasks have been completed without errors.
This activity can be configured to: - Set Success Responses: Define the HTTP status code, success message, and response body to be sent back to a client if the workflow was triggered by an HTTP request (likely in conjunction with "HTTP Endpoint" and "HTTP Response" activities). Typically, this would be a 200 OK or 201 Created response.
- Output Success Data: Define what data should be returned as the output of the workflow when it completes successfully (using "Set Output" activity from "Composition" section might be more common for output definition, but "Success Activity" could also have output settings).
- Log Success Events: Write success messages or completion details to logs for monitoring and auditing purposes.
- Terminate Workflow with Success Status: Mark the workflow instance as successfully completed.
- Use Cases:
- Success Responses for API Workflows: Defining how a workflow-based API should respond when a request is processed successfully (e.g., returning 200 OK or 201 Created responses with data in the response body).
- Successful Workflow Completion Handling: Defining actions to be taken when a workflow completes its intended tasks successfully, such as sending confirmation messages or updating status indicators.
- Standard Success Response Definition: Ensuring a consistent and well-defined success response for workflows, especially those acting as services or APIs.
How to Use Response Activities (within Workflows):
- 1. Locate the Response section within the Workflows area of the Activities Panel.
- 2. Drag and drop a Response activity ("Failure Activity", "Redirect Activity", or "Success Activity") onto your workflow canvas, typically within the context of a workflow that is designed to act as a service or API endpoint.
-
3. Configure the properties of the chosen activity:
- For Failure Activity and Success Activity: Define the HTTP status code, response body, headers, and any logging or error handling logic.
- For Redirect Activity: Configure the redirection target (either within the workflow or an external URL, depending on the intended use case).
- 4. Connect these Response activities to different paths in your workflow logic to define how the workflow should respond in different scenarios (success, failure, redirection). For instance, connect a "Failure Activity" to error handling paths and a "Success Activity" to the main successful execution path.
- 5. Save and activate your workflow. When executed, these Response activities will control how the workflow responds to different outcomes, particularly in service-oriented scenarios.
Benefits of Using Response Section (within Workflows):
- Service-Oriented Workflow Design: Enables the creation of workflows that can act as robust services or API endpoints by providing explicit control over success, failure, and redirection responses.
- Clear Outcome Handling: Provides dedicated activities for defining how workflows should handle different execution outcomes, making workflow logic more explicit and maintainable.
- Improved API Design: Facilitates the design of well-structured and informative API responses from workflows, including proper HTTP status codes and response bodies for success and error scenarios.
- Robust Error Management: "Failure Activity" allows for centralized and consistent error handling within workflows acting as services.
- Workflow Outcome Control: Provides fine-grained control over how workflows signal their completion status and respond to clients or calling systems.
By utilizing the Response section activities within the Workflows area, you can design sophisticated, service-oriented workflows that not only perform automated tasks but also communicate their outcomes effectively and handle different execution scenarios in a well-defined and standardized manner, particularly when acting as APIs or web services.