End icon

End

End Node

Overview

This node, named End, is designed to signal the completion of a business process within an n8n workflow. It interacts with an external API to update the state of a process instance as either "Approved" or "Rejected". This node is typically used at the end of a workflow to finalize and record the outcome of a process, such as approving or rejecting a request.

Practical examples:

  • Marking a loan application as approved or rejected after all checks are complete.
  • Finalizing a user onboarding process based on prior workflow steps.
  • Recording the result of an automated review in a business process management system.

Properties

Name Type Meaning
Type options Determines the final state to set for the process instance: "Approved" or "Rejected".
Business Key hidden The unique identifier (business key) for the process instance being finalized.
Execution ID hidden The execution ID of the current n8n workflow run.

Output

The node outputs a single JSON object with the following structure:

{
  "state": "<Type value>",
  "businessKey": "<Business Key value>",
  "executionId": "<Execution ID value>"
}
  • state: The selected type ("UpdateStateToApproved" or "UpdateStateToRejected").
  • businessKey: The business key used to identify the process instance.
  • executionId: The execution ID of the current workflow run.

Note: This node does not output binary data.

Dependencies

  • External Service: Requires access to https://06.dev.fimple.co.uk/api/v1/Saga/BpmInstances/ endpoint.
  • API Call: Makes a POST request to update the process instance state.
  • n8n Configuration: The node expects that the business key and execution ID are available from previous nodes or the workflow context.

Troubleshooting

  • Missing Business Key or Execution ID:
    If either the business key or execution ID is missing, the API call will not be made, and the output will only reflect the input parameters. Ensure that the required fields are populated, typically via upstream nodes like a Webhook.
  • API Errors:
    If the external API returns an error (e.g., network issues, invalid keys), check the console logs for details (console.log("res", i)). Make sure the endpoint is reachable and the provided keys are valid.
  • Permission Issues:
    If authentication is required by the external API, ensure that any necessary credentials or tokens are configured in your environment.

Links and References

Discussion