From 2f3879aa2a7a7b88bd71ece6f13631e230ba18a4 Mon Sep 17 00:00:00 2001 From: David Kiania Date: Wed, 8 Apr 2026 18:54:42 +0300 Subject: [PATCH] Add n8n workflow templates and change webhook port to 8888 Port 8000 was already in use on the host. Updated uvicorn to listen on 8888. Added 6 importable n8n workflow JSON files for Jimi push data forwarding (OBD, faults, alarms, GPS, heartbeats, trips). Co-Authored-By: Claude Opus 4.6 --- docker-compose.yaml | 6 +- n8n-workflows/jimi_pushalarm.json | 91 ++++++++++++++++++++++++++ n8n-workflows/jimi_pushfaultinfo.json | 91 ++++++++++++++++++++++++++ n8n-workflows/jimi_pushgps.json | 91 ++++++++++++++++++++++++++ n8n-workflows/jimi_pushhb.json | 91 ++++++++++++++++++++++++++ n8n-workflows/jimi_pushobd.json | 91 ++++++++++++++++++++++++++ n8n-workflows/jimi_pushtripreport.json | 91 ++++++++++++++++++++++++++ 7 files changed, 549 insertions(+), 3 deletions(-) create mode 100644 n8n-workflows/jimi_pushalarm.json create mode 100644 n8n-workflows/jimi_pushfaultinfo.json create mode 100644 n8n-workflows/jimi_pushgps.json create mode 100644 n8n-workflows/jimi_pushhb.json create mode 100644 n8n-workflows/jimi_pushobd.json create mode 100644 n8n-workflows/jimi_pushtripreport.json diff --git a/docker-compose.yaml b/docker-compose.yaml index 23745d4..cd5cd27 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -40,16 +40,16 @@ services: build: context: . dockerfile: Dockerfile - command: sh -c "python run_migrations.py && uvicorn webhook_receiver_rev:app --host 0.0.0.0 --port 8000 --workers 2" + command: sh -c "python run_migrations.py && uvicorn webhook_receiver_rev:app --host 0.0.0.0 --port 8888 --workers 2" restart: always depends_on: timescale_db: condition: service_healthy env_file: .env # No host port binding — Coolify's Traefik proxy routes traffic internally. - # Set the webhook domain in Coolify UI pointing to this service on port 8000. + # Set the webhook domain in Coolify UI pointing to this service on port 8888. healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8000/health"] + test: ["CMD", "curl", "-f", "http://localhost:8888/health"] interval: 30s timeout: 5s retries: 3 diff --git a/n8n-workflows/jimi_pushalarm.json b/n8n-workflows/jimi_pushalarm.json new file mode 100644 index 0000000..ba3e3c2 --- /dev/null +++ b/n8n-workflows/jimi_pushalarm.json @@ -0,0 +1,91 @@ +{ + "name": "Jimi Alarm Push", + "nodes": [ + { + "parameters": { + "httpMethod": "POST", + "path": "pushalarm", + "responseMode": "responseNode", + "options": {} + }, + "id": "webhook-pushalarm", + "name": "Webhook", + "type": "n8n-nodes-base.webhook", + "typeVersion": 2, + "position": [260, 300], + "webhookId": "pushalarm" + }, + { + "parameters": { + "respondWith": "json", + "responseBody": "={{ JSON.stringify({\"code\": 0, \"msg\": \"success\"}) }}", + "options": {} + }, + "id": "respond-pushalarm", + "name": "Respond to Jimi", + "type": "n8n-nodes-base.respondToWebhook", + "typeVersion": 1.1, + "position": [480, 300] + }, + { + "parameters": { + "method": "POST", + "url": "https://tshook.rahamafresh.com/pushalarm", + "sendBody": true, + "contentType": "form-urlencoded", + "bodyParameters": { + "parameters": [ + { + "name": "token", + "value": "={{ $('Webhook').item.json.body.token }}" + }, + { + "name": "data_list", + "value": "={{ $('Webhook').item.json.body.data_list }}" + } + ] + }, + "options": { + "timeout": 30000 + } + }, + "id": "http-pushalarm", + "name": "Forward to Webhook Receiver", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, + "position": [700, 300] + } + ], + "connections": { + "Webhook": { + "main": [ + [ + { + "node": "Respond to Jimi", + "type": "main", + "index": 0 + } + ] + ] + }, + "Respond to Jimi": { + "main": [ + [ + { + "node": "Forward to Webhook Receiver", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "settings": { + "executionOrder": "v1" + }, + "tags": [ + { + "name": "Jimi Tracksolid" + } + ] +} diff --git a/n8n-workflows/jimi_pushfaultinfo.json b/n8n-workflows/jimi_pushfaultinfo.json new file mode 100644 index 0000000..2c19c6c --- /dev/null +++ b/n8n-workflows/jimi_pushfaultinfo.json @@ -0,0 +1,91 @@ +{ + "name": "Jimi Fault Code Push", + "nodes": [ + { + "parameters": { + "httpMethod": "POST", + "path": "pushfaultinfo", + "responseMode": "responseNode", + "options": {} + }, + "id": "webhook-pushfaultinfo", + "name": "Webhook", + "type": "n8n-nodes-base.webhook", + "typeVersion": 2, + "position": [260, 300], + "webhookId": "pushfaultinfo" + }, + { + "parameters": { + "respondWith": "json", + "responseBody": "={{ JSON.stringify({\"code\": 0, \"msg\": \"success\"}) }}", + "options": {} + }, + "id": "respond-pushfaultinfo", + "name": "Respond to Jimi", + "type": "n8n-nodes-base.respondToWebhook", + "typeVersion": 1.1, + "position": [480, 300] + }, + { + "parameters": { + "method": "POST", + "url": "https://tshook.rahamafresh.com/pushfaultinfo", + "sendBody": true, + "contentType": "form-urlencoded", + "bodyParameters": { + "parameters": [ + { + "name": "token", + "value": "={{ $('Webhook').item.json.body.token }}" + }, + { + "name": "data_list", + "value": "={{ $('Webhook').item.json.body.data_list }}" + } + ] + }, + "options": { + "timeout": 30000 + } + }, + "id": "http-pushfaultinfo", + "name": "Forward to Webhook Receiver", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, + "position": [700, 300] + } + ], + "connections": { + "Webhook": { + "main": [ + [ + { + "node": "Respond to Jimi", + "type": "main", + "index": 0 + } + ] + ] + }, + "Respond to Jimi": { + "main": [ + [ + { + "node": "Forward to Webhook Receiver", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "settings": { + "executionOrder": "v1" + }, + "tags": [ + { + "name": "Jimi Tracksolid" + } + ] +} diff --git a/n8n-workflows/jimi_pushgps.json b/n8n-workflows/jimi_pushgps.json new file mode 100644 index 0000000..721a991 --- /dev/null +++ b/n8n-workflows/jimi_pushgps.json @@ -0,0 +1,91 @@ +{ + "name": "Jimi GPS Push", + "nodes": [ + { + "parameters": { + "httpMethod": "POST", + "path": "pushgps", + "responseMode": "responseNode", + "options": {} + }, + "id": "webhook-pushgps", + "name": "Webhook", + "type": "n8n-nodes-base.webhook", + "typeVersion": 2, + "position": [260, 300], + "webhookId": "pushgps" + }, + { + "parameters": { + "respondWith": "json", + "responseBody": "={{ JSON.stringify({\"code\": 0, \"msg\": \"success\"}) }}", + "options": {} + }, + "id": "respond-pushgps", + "name": "Respond to Jimi", + "type": "n8n-nodes-base.respondToWebhook", + "typeVersion": 1.1, + "position": [480, 300] + }, + { + "parameters": { + "method": "POST", + "url": "https://tshook.rahamafresh.com/pushgps", + "sendBody": true, + "contentType": "form-urlencoded", + "bodyParameters": { + "parameters": [ + { + "name": "token", + "value": "={{ $('Webhook').item.json.body.token }}" + }, + { + "name": "data_list", + "value": "={{ $('Webhook').item.json.body.data_list }}" + } + ] + }, + "options": { + "timeout": 30000 + } + }, + "id": "http-pushgps", + "name": "Forward to Webhook Receiver", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, + "position": [700, 300] + } + ], + "connections": { + "Webhook": { + "main": [ + [ + { + "node": "Respond to Jimi", + "type": "main", + "index": 0 + } + ] + ] + }, + "Respond to Jimi": { + "main": [ + [ + { + "node": "Forward to Webhook Receiver", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "settings": { + "executionOrder": "v1" + }, + "tags": [ + { + "name": "Jimi Tracksolid" + } + ] +} diff --git a/n8n-workflows/jimi_pushhb.json b/n8n-workflows/jimi_pushhb.json new file mode 100644 index 0000000..da97f3d --- /dev/null +++ b/n8n-workflows/jimi_pushhb.json @@ -0,0 +1,91 @@ +{ + "name": "Jimi Heartbeat Push", + "nodes": [ + { + "parameters": { + "httpMethod": "POST", + "path": "pushhb", + "responseMode": "responseNode", + "options": {} + }, + "id": "webhook-pushhb", + "name": "Webhook", + "type": "n8n-nodes-base.webhook", + "typeVersion": 2, + "position": [260, 300], + "webhookId": "pushhb" + }, + { + "parameters": { + "respondWith": "json", + "responseBody": "={{ JSON.stringify({\"code\": 0, \"msg\": \"success\"}) }}", + "options": {} + }, + "id": "respond-pushhb", + "name": "Respond to Jimi", + "type": "n8n-nodes-base.respondToWebhook", + "typeVersion": 1.1, + "position": [480, 300] + }, + { + "parameters": { + "method": "POST", + "url": "https://tshook.rahamafresh.com/pushhb", + "sendBody": true, + "contentType": "form-urlencoded", + "bodyParameters": { + "parameters": [ + { + "name": "token", + "value": "={{ $('Webhook').item.json.body.token }}" + }, + { + "name": "data_list", + "value": "={{ $('Webhook').item.json.body.data_list }}" + } + ] + }, + "options": { + "timeout": 30000 + } + }, + "id": "http-pushhb", + "name": "Forward to Webhook Receiver", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, + "position": [700, 300] + } + ], + "connections": { + "Webhook": { + "main": [ + [ + { + "node": "Respond to Jimi", + "type": "main", + "index": 0 + } + ] + ] + }, + "Respond to Jimi": { + "main": [ + [ + { + "node": "Forward to Webhook Receiver", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "settings": { + "executionOrder": "v1" + }, + "tags": [ + { + "name": "Jimi Tracksolid" + } + ] +} diff --git a/n8n-workflows/jimi_pushobd.json b/n8n-workflows/jimi_pushobd.json new file mode 100644 index 0000000..2be4795 --- /dev/null +++ b/n8n-workflows/jimi_pushobd.json @@ -0,0 +1,91 @@ +{ + "name": "Jimi OBD Push", + "nodes": [ + { + "parameters": { + "httpMethod": "POST", + "path": "pushobd", + "responseMode": "responseNode", + "options": {} + }, + "id": "webhook-pushobd", + "name": "Webhook", + "type": "n8n-nodes-base.webhook", + "typeVersion": 2, + "position": [260, 300], + "webhookId": "pushobd" + }, + { + "parameters": { + "respondWith": "json", + "responseBody": "={{ JSON.stringify({\"code\": 0, \"msg\": \"success\"}) }}", + "options": {} + }, + "id": "respond-pushobd", + "name": "Respond to Jimi", + "type": "n8n-nodes-base.respondToWebhook", + "typeVersion": 1.1, + "position": [480, 300] + }, + { + "parameters": { + "method": "POST", + "url": "https://tshook.rahamafresh.com/pushobd", + "sendBody": true, + "contentType": "form-urlencoded", + "bodyParameters": { + "parameters": [ + { + "name": "token", + "value": "={{ $('Webhook').item.json.body.token }}" + }, + { + "name": "data_list", + "value": "={{ $('Webhook').item.json.body.data_list }}" + } + ] + }, + "options": { + "timeout": 30000 + } + }, + "id": "http-pushobd", + "name": "Forward to Webhook Receiver", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, + "position": [700, 300] + } + ], + "connections": { + "Webhook": { + "main": [ + [ + { + "node": "Respond to Jimi", + "type": "main", + "index": 0 + } + ] + ] + }, + "Respond to Jimi": { + "main": [ + [ + { + "node": "Forward to Webhook Receiver", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "settings": { + "executionOrder": "v1" + }, + "tags": [ + { + "name": "Jimi Tracksolid" + } + ] +} diff --git a/n8n-workflows/jimi_pushtripreport.json b/n8n-workflows/jimi_pushtripreport.json new file mode 100644 index 0000000..ebbdac3 --- /dev/null +++ b/n8n-workflows/jimi_pushtripreport.json @@ -0,0 +1,91 @@ +{ + "name": "Jimi Trip Report Push", + "nodes": [ + { + "parameters": { + "httpMethod": "POST", + "path": "pushtripreport", + "responseMode": "responseNode", + "options": {} + }, + "id": "webhook-pushtripreport", + "name": "Webhook", + "type": "n8n-nodes-base.webhook", + "typeVersion": 2, + "position": [260, 300], + "webhookId": "pushtripreport" + }, + { + "parameters": { + "respondWith": "json", + "responseBody": "={{ JSON.stringify({\"code\": 0, \"msg\": \"success\"}) }}", + "options": {} + }, + "id": "respond-pushtripreport", + "name": "Respond to Jimi", + "type": "n8n-nodes-base.respondToWebhook", + "typeVersion": 1.1, + "position": [480, 300] + }, + { + "parameters": { + "method": "POST", + "url": "https://tshook.rahamafresh.com/pushtripreport", + "sendBody": true, + "contentType": "form-urlencoded", + "bodyParameters": { + "parameters": [ + { + "name": "token", + "value": "={{ $('Webhook').item.json.body.token }}" + }, + { + "name": "data_list", + "value": "={{ $('Webhook').item.json.body.data_list }}" + } + ] + }, + "options": { + "timeout": 30000 + } + }, + "id": "http-pushtripreport", + "name": "Forward to Webhook Receiver", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.2, + "position": [700, 300] + } + ], + "connections": { + "Webhook": { + "main": [ + [ + { + "node": "Respond to Jimi", + "type": "main", + "index": 0 + } + ] + ] + }, + "Respond to Jimi": { + "main": [ + [ + { + "node": "Forward to Webhook Receiver", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "settings": { + "executionOrder": "v1" + }, + "tags": [ + { + "name": "Jimi Tracksolid" + } + ] +}