File size: 1,122 Bytes
8bb5cbf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# n8n-activate.sh
# This script manually flips the 'active' bit in the n8n SQLite database.

DB_PATH="/data/.n8n/database.sqlite"

if [ ! -f "$DB_PATH" ]; then
  echo "Error: Database not found at $DB_PATH"
  exit 1
fi

echo "Surgically activating all production workflows..."
# Set all workflows with 'PRODUCTION' in the name to active
sqlite3 "$DB_PATH" "UPDATE workflow_entity SET active = 1 WHERE name LIKE '%PRODUCTION%';"

# Also ensure the webhook_entity table is populated for the handler
# We use a subquery to get the ID of the handler
WORKFLOW_ID=$(sqlite3 "$DB_PATH" "SELECT id FROM workflow_entity WHERE name = 'Stripe Webhook Handler - PRODUCTION' LIMIT 1;")

if [ -n "$WORKFLOW_ID" ]; then
  echo "Registering webhook route for $WORKFLOW_ID..."
  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);"
else
  echo "Error: Stripe Webhook Handler not found in database."
fi

echo "Activation complete. Restarting n8n for routing refresh..."