iTwin Forms icon

iTwin Forms

Comprehensive iTwin Forms API

Overview

This node integrates with the iTwin Forms API, allowing users to interact with form data and attachments within the iTwin platform. Specifically, the "Get attachment file by ID" operation retrieves the binary file of a specific attachment associated with a form data instance. This is useful when you need to programmatically access or download files submitted as part of forms, such as images, documents, or other media.

Practical examples include:

  • Automatically downloading and processing attachments submitted through forms.
  • Archiving form attachments in external storage.
  • Triggering workflows based on the content of attached files.

Properties

Name Meaning
ID The ID of the form data instance for which to get an attachment.
Attachment ID The ID of the attachment whose file you want to retrieve.

Output

The node outputs the retrieved attachment file. The output structure includes:

  • A json field containing metadata or result information about the operation.
  • The actual attachment file is expected to be available as binary data attached to the output item (typical for file retrieval nodes).

Since the source code does not explicitly show binary handling but this is a file retrieval operation, it is standard that the node outputs the attachment file as binary data under the binary property of the output item.

Dependencies

  • Requires an API key credential for authenticating with the iTwin Forms API (configured in n8n as an OAuth2 credential).
  • Internet access to reach the iTwin Forms API endpoints.
  • The node depends on the bundled FormsOpenApiInterpreter class to handle API operations.

Troubleshooting

  • Common issues:

    • Invalid or missing form data instance ID or attachment ID will cause errors.
    • Authentication failures if the API credentials are not set up correctly.
    • Network connectivity problems can prevent successful API calls.
  • Error messages:

    • "Unknown operation: <operation>": Indicates the specified operation name is invalid or unsupported.
    • API errors returned from the iTwin Forms service will be propagated; check the error message for details.
  • Resolutions:

    • Verify that the IDs provided are correct and exist in the iTwin Forms system.
    • Ensure the API authentication token is valid and has necessary permissions.
    • Check network connectivity and proxy settings if applicable.

Links and References

Discussion