bonFHIR Trigger icon

bonFHIR Trigger

Starts the workflow when a FHIR Subscription is triggered

Overview

This node acts as a trigger for workflows based on FHIR (Fast Healthcare Interoperability Resources) Subscriptions. It listens for events from a FHIR server and starts the workflow when a relevant subscription notification is received. The node supports two modes of operation:

  • Webhook mode: Acts as a standard webhook receiving POST requests at a stable URL.
  • Resthook / FHIR Client mode: Emulates a FHIR server receiving REST API calls with PUT methods, compatible with how some FHIR servers like HAPI FHIR operate.

Common scenarios include automating healthcare workflows that react to changes in patient data, observations, or other clinical resources by subscribing to specific FHIR resource updates. For example, triggering a workflow when a new Observation resource is created or updated.

Properties

Name Meaning
Event The type of event to listen for. Currently only "FHIR Subscription" is supported.
Authentication Method used to authenticate requests to the FHIR server. Options include Basic Auth, Custom Auth, Digest Auth, Header Auth, None, OAuth1, OAuth2, Query Auth.
Base URL The base URL of the FHIR server API to which subscription requests are sent.
Mode How the trigger behaves: either as a standard webhook (webhook) or as a Resthook/FHIR client (resthook).
Path Prefix Webhook path prefix used to differentiate multiple webhooks; applicable only in webhook mode.
Resource Type The FHIR resource type to subscribe to (e.g., Patient, Observation, Condition). A custom resource type can also be specified.
Custom Resource Type If "Custom" resource type is selected, this string specifies the custom resource type name.
Search Criteria Additional search criteria to filter the subscription notifications. Should not include the resource type or leading "?".
Reason Human-readable explanation for why the subscription is defined.
Shared Secret A secret token used to secure the webhook by validating incoming requests. Leave empty to disable this security feature.
Payload The payload format for subscription notifications. Default is application/fhir+json.
Ignore SSL Issues Whether to ignore SSL certificate validation errors when connecting to the FHIR server. Useful for self-signed certificates or testing environments.

Output

The node outputs JSON data representing the FHIR resource received via the subscription notification. The output structure corresponds directly to the FHIR resource JSON payload sent by the FHIR server.

  • The main output contains an array with one item per trigger event.
  • Each item includes the full JSON representation of the FHIR resource that triggered the subscription.
  • If the shared secret is set, the node verifies the incoming request header matches it before processing.
  • Binary data is not handled by this node; all data is JSON-based FHIR resources.

Dependencies

  • Requires access to a FHIR server supporting Subscription resources and REST API.
  • Needs appropriate authentication credentials configured according to the chosen authentication method.
  • The node uses HTTP(S) requests to create, check, and delete subscriptions on the FHIR server.
  • Environment should allow inbound HTTP requests to the webhook URL if using webhook mode.
  • No additional external libraries beyond those bundled with n8n and the node's dependencies.

Troubleshooting

  • Subscription creation failure: If the node cannot create a subscription on the FHIR server, verify the Base URL, authentication credentials, and network connectivity. Check the FHIR server logs for errors related to subscription creation.
  • Webhook security mismatch: If the shared secret is set but incoming requests do not have the matching header, the node will ignore the request. Ensure the FHIR server sends the correct X-Subscription-Auth header.
  • SSL certificate issues: If connecting to a FHIR server with a self-signed or invalid SSL certificate, enable "Ignore SSL Issues" to bypass validation.
  • Resource type or search criteria errors: Invalid resource types or malformed search criteria may cause subscription failures. Confirm these values conform to FHIR specifications.
  • Mode mismatch: Using the wrong mode (webhook vs resthook) may cause the FHIR server to send requests incompatible with the node’s expectations. Match the mode to your FHIR server’s subscription mechanism.

Links and References

Discussion