GTO-Custom-AI commited on
Commit
8bb5cbf
·
verified ·
1 Parent(s): d75f749

Upload activate_n8n.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. activate_n8n.sh +27 -0
activate_n8n.sh ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # n8n-activate.sh
3
+ # This script manually flips the 'active' bit in the n8n SQLite database.
4
+
5
+ DB_PATH="/data/.n8n/database.sqlite"
6
+
7
+ if [ ! -f "$DB_PATH" ]; then
8
+ echo "Error: Database not found at $DB_PATH"
9
+ exit 1
10
+ fi
11
+
12
+ echo "Surgically activating all production workflows..."
13
+ # Set all workflows with 'PRODUCTION' in the name to active
14
+ sqlite3 "$DB_PATH" "UPDATE workflow_entity SET active = 1 WHERE name LIKE '%PRODUCTION%';"
15
+
16
+ # Also ensure the webhook_entity table is populated for the handler
17
+ # We use a subquery to get the ID of the handler
18
+ WORKFLOW_ID=$(sqlite3 "$DB_PATH" "SELECT id FROM workflow_entity WHERE name = 'Stripe Webhook Handler - PRODUCTION' LIMIT 1;")
19
+
20
+ if [ -n "$WORKFLOW_ID" ]; then
21
+ echo "Registering webhook route for $WORKFLOW_ID..."
22
+ sqlite3 "$DB_PATH" "INSERT OR REPLACE INTO webhook_entity (workflowId, webhookPath, method, node, webhookId, pathLength) VALUES ('$WORKFLOW_ID', 'stripe-webhook', 'POST', 'webhook-node', 'stripe-webhook', 15);"
23
+ else
24
+ echo "Error: Stripe Webhook Handler not found in database."
25
+ fi
26
+
27
+ echo "Activation complete. Restarting n8n for routing refresh..."