The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Check Inventory",
"nodes": [
{
"parameters": {
"path": "check_inventory",
"httpMethod": "POST",
"responseMode": "responseNode",
"options": {}
},
"id": "webhook-1",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"jsCode": "// n8n webhook may put POST body in $json.body or at root level\nconst data = $json.body || $json;\n\n// Validate required parameters\nif (!data.productName && !data.productSku) {\n return {\n _error: true,\n success: false,\n message: 'Please provide either productName or productSku to check inventory.',\n requiredParameters: {\n productName: { type: 'string', description: 'Product name to search for (e.g., \"pepperoni pizza\")' },\n productSku: { type: 'string', description: 'Product SKU code (e.g., \"PIZZA-001\")' },\n quantity: { type: 'number', description: 'Quantity to check availability for (optional, default: 1)' }\n },\n example: { productName: 'pepperoni pizza', quantity: 2 }\n };\n}\n\n// Get integration from _integrations object (keyed by integration type)\nconst integrations = data._integrations || {};\nconst integration = integrations.inventory_api;\n\nif (!integration || !integration.apiUrl) {\n return {\n _error: true,\n success: false,\n message: 'No API integration configured for this client. Please set up an inventory_api integration in the admin panel.',\n debug: { hasIntegrations: !!data._integrations, keys: Object.keys(integrations) }\n };\n}\n\n// Use full URL from integration (no path appending needed)\n// Replace any placeholders if present\nlet apiUrl = integration.apiUrl;\napiUrl = apiUrl.replace('{productName}', encodeURIComponent(data.productName || ''));\napiUrl = apiUrl.replace('{productSku}', encodeURIComponent(data.productSku || ''));\n\n// Prepare API call config\nreturn {\n productName: data.productName,\n productSku: data.productSku,\n quantity: data.quantity || 1,\n _apiConfig: {\n url: apiUrl,\n key: integration.apiKey,\n method: integration.method || 'POST',\n authMethod: integration.authMethod || 'bearer'\n }\n};"
},
"id": "prepare-request",
"name": "Prepare API Request",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
450,
300
]
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{ $json._error }}",
"value2": true
}
]
}
},
"id": "if-error",
"name": "Has Error?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
650,
300
]
},
{
"parameters": {
"method": "={{ $json._apiConfig.method }}",
"url": "={{ $json._apiConfig.url }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "=Bearer {{ $json._apiConfig.key }}"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"productName\": \"{{ $json.productName }}\",\n \"productSku\": \"{{ $json.productSku }}\",\n \"quantity\": {{ $json.quantity }}\n}",
"options": {
"timeout": 10000
}
},
"id": "http-api-call",
"name": "Call Client API",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
900,
400
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify($json) }}"
},
"id": "respond-error",
"name": "Return Error",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
900,
200
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify($json) }}"
},
"id": "respond-success",
"name": "Return Result",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
1100,
400
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Prepare API Request",
"type": "main",
"index": 0
}
]
]
},
"Prepare API Request": {
"main": [
[
{
"node": "Has Error?",
"type": "main",
"index": 0
}
]
]
},
"Has Error?": {
"main": [
[
{
"node": "Return Error",
"type": "main",
"index": 0
}
],
[
{
"node": "Call Client API",
"type": "main",
"index": 0
}
]
]
},
"Call Client API": {
"main": [
[
{
"node": "Return Result",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {},
"versionId": "4",
"id": "check_inventory"
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Check Inventory. Uses httpRequest. Webhook trigger; 6 nodes.
Source: https://github.com/TropoEU/CSAIProj/blob/45562ba7faf947f8be6511dba03245871bc8d5e1/n8n-workflows/check_inventory.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This n8n template provides enterprise-level version control for your workflows using GitHub integration. Stop losing hours to broken workflows and manual exports – get proper commit history, visual di
This flow creates dummy files for every item added in your *Arrs (Radarr/Sonarr) with the tag .
This workflow acts as a central API gateway for all technical indicator agents in the Binance Spot Market Quant AI system. It listens for incoming webhook requests and dynamically routes them to the c
Sign PDF documents with legally-compliant digital signatures using X.509 certificates. Supports multiple PAdES signature levels (B, T, LT, LTA) with optional visible stamps.
📡 This workflow serves as the central Alpha Vantage API fetcher for Tesla trading indicators, delivering cleaned 20-point JSON outputs for three timeframes: , , and . It is required by the following a