4. External Service Integrations and Advanced Nodes
n8n\'s power comes from its ability to integrate with various external services. You can securely connect using Credentials and implement complex logic with Advanced Nodes.
4.1. External Service Integrations and Credentials
n8n can connect with countless apps, including APIs, databases, and cloud services. Most integrations are authenticated via Credentials.
- In the n8n UI, click \'Credentials\' in the left panel.
- Click \'New Credential\' and select the type of service you want to connect to (e.g., Google Sheets API, Custom HTTP Header Auth).
- Enter the required authentication information (API key, username/password, etc.) and save.
These created credentials can then be reused in nodes that connect to that service.
4.2. Frequently Used Advanced Nodes
- HTTP Request Node: Essential for making requests to any RESTful API and processing responses. Used to fetch, send, or modify data.
- Code Node: Allows you to write custom JavaScript code to implement complex data transformations, conditional logic, custom functions, and more.
- If Node: Branches the workflow\'s flow based on a specific condition (e.g., `{{ $json.status === "success" }}`).
- Merge Node: Combines several branched workflow paths back into a single flow.
- Split In Batches Node: Used to process a large number of items in smaller batches, which helps adhere to API rate limits or optimize performance.
4.3. Integration Example: Fetching Data from an API and Sending Notifications to Slack
You can fetch data from an external API with an HTTP Request node, process the data with a Code node, and then send the results to Slack using a Slack node.
// Example JavaScript for data processing in a Code node
return items.map(item => {
return { json: {
title: item.json.data.title.toUpperCase(),
url: item.json.data.url
}};
});