End icon

End

End Node

Overview

This node, named End, is designed to signal the completion of a process instance in an external BPM (Business Process Management) system. It allows you to mark a workflow as either "Approved" or "Rejected" by sending a POST request to a specified API endpoint with relevant identifiers. This node is typically used at the end of an n8n workflow to update the state of a business process managed outside of n8n.

Common scenarios:

  • Marking a business process as approved or rejected after automated checks.
  • Integrating n8n workflows with external BPM systems for process state management.
  • Automating the closure of tasks based on workflow outcomes.

Practical example:
After processing a loan application, use this node to notify the BPM system that the application has been approved or rejected, passing along the necessary business key and execution ID.

Properties

Name Type Meaning
Type options Specifies the final state to set for the process instance. Options: Approved or Rejected.
Business Key hidden The unique identifier for the business process instance. Required for API call.
Execution ID hidden The unique execution ID of the current workflow run. Required for API call.

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 in the API call.
  • executionId: The execution ID used in the API call.

Dependencies

  • External Service: Requires access to https://06.dev.fimple.co.uk/api/v1/Saga/BpmInstances/ for updating process states.
  • API Authentication: The code does not show explicit authentication, but the endpoint may require API keys or other credentials depending on your environment.
  • n8n Configuration: The node expects certain data from previous nodes (e.g., the "Webhook" node for the business key).

Troubleshooting

  • Missing Business Key or Execution ID: If either is missing, the API call will not be made, and the output will still be returned. Ensure upstream nodes provide these values.
  • API Errors: If the external API returns an error (e.g., invalid business key, network issues), it may not be visible unless you check the n8n logs or console output.
  • Incorrect Endpoint or Permissions: If the endpoint URL changes or your credentials are insufficient, the node will fail to update the process state.

Links and References

Discussion