Actions6
Overview
This node integrates with the Swan.io API, allowing users to perform various operations related to financial accounts and transactions. It supports executing custom GraphQL queries as well as predefined operations such as retrieving account or transaction details, updating account information, granting consent with a server signature, and initiating credit transfers.
Common scenarios include:
- Fetching detailed account or transaction data from Swan.io.
- Performing custom GraphQL queries for advanced or unsupported API calls.
- Managing consents securely using server-side signatures.
- Initiating multiple credit transfers programmatically.
Practical example:
- A user wants to retrieve transaction details by providing a transaction ID and using a project access token.
- Another use case is updating an account's name by specifying the account ID and new name.
- Executing a custom GraphQL query to fetch specific data not covered by built-in operations.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose between "User Access Token" or "Project Access Token" for API authentication. |
| Query | The GraphQL query string to execute when using the Custom operation. |
| Variables | JSON object containing variables for the GraphQL query in the Custom operation. |
Output
The node outputs JSON objects representing the response from the Swan.io API based on the selected operation:
- For Custom operation: The full JSON response of the executed GraphQL query.
- For Account operation: JSON object with account details.
- For Transaction operation: JSON object with transaction details.
- For UpdateAccount operation: JSON object reflecting the updated account information.
- For GrantConsentWithServerSignature operation: JSON object confirming the consent grant.
- For InitiateCreditTransfers operation: JSON object with details about the initiated credit transfers.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authentication, either a user access token or a project access token.
- Uses internal helper functions to send requests to the Swan.io API.
- For some operations (e.g., granting consent), a server consent private key must be configured within the user access token credentials.
- No additional external dependencies beyond the Swan.io API and n8n credential management.
Troubleshooting
Error: "This resource needs a project token to be requested"
Occurs if you try to access the Transaction operation without selecting Project Access Token authentication. Fix by choosing the correct authentication type.Error: "This resource needs a user token to be requested"
Happens when operations like Grant Consent or Initiate Credit Transfers are attempted without User Access Token authentication. Select the appropriate authentication.Error: "This resource needs a Server Consent Private Key configured to be used"
When granting consent with server signature, ensure that the server consent private key is set up in the user access token credentials.Unsupported operation and/or resource
Indicates an invalid or unsupported operation was selected. Verify the operation name and resource.Invalid GraphQL query or variables
For the Custom operation, malformed queries or incorrect variables may cause API errors. Validate your GraphQL syntax and variable structure.
Links and References
- Swan.io API Documentation (general reference for API capabilities)
- GraphQL Basics (for understanding query structure)
- n8n documentation on Creating Custom Nodes