← Back
Fetch data from External API and send to Database
n8n_2000_workflows / fetch-data-external-api-database.json
Complexity: simpleNodes: 4
apibasedatadatabaseerrorexternalfetchfetch-data-external-api-database.jsonfromhttprequestincomingn8nn8n_2000_workflowsnodessendsimpleslacktotriggerwebhook
Node Overview
- Incoming Trigger – n8n-nodes-base.webhook
- Fetch data from External API – n8n-nodes-base.httpRequest
- Send to Database – n8n-nodes-base.httpRequest
- Send Error to Slack – n8n-nodes-base.slack
Workflow JSON
{
"name": "Fetch data from External API and send to Database",
"nodes": [
{
"id": "trigger-external-api",
"name": "Incoming Trigger",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
-600,
195000
],
"parameters": {
"httpMethod": "POST",
"path": "fetch-data-from-external-api-and-send-to-database",
"responseCode": 200,
"responseMode": "onReceived"
}
},
{
"id": "fetch-external-api",
"name": "Fetch data from External API",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
-300,
195000
],
"parameters": {
"method": "GET",
"url": "https://api.example.com/external-api",
"responseFormat": "json"
}
},
{
"id": "send-database",
"name": "Send to Database",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
300,
195000
],
"parameters": {
"method": "POST",
"url": "https://api.example.com/database",
"responseFormat": "json",
"options": {}
}
},
{
"id": "error-handler-600-195000",
"name": "Send Error to Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 1,
"position": [
600,
195000
],
"parameters": {
"resource": "message",
"operation": "post",
"channel": "#automation-alerts",
"text": "={{ $json.get('error_message', 'An error occurred') }}"
}
}
],
"connections": {
"Incoming Trigger": {
"main": [
[
{
"node": "Fetch data from External API",
"type": "main",
"index": 0
}
]
]
},
"Fetch data from External API": {
"main": [
{
"node": "Send to Database",
"type": "main",
"index": 0
}
]
},
"Send to Database": {
"main": [
[
{
"node": "Send Error to Slack",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {},
"active": false
}