From f6637080fc74b125d6c83338e563719375789262 Mon Sep 17 00:00:00 2001 From: Wolfgang Date: Fri, 23 Jan 2026 14:27:03 +0100 Subject: [PATCH] fix: Workflow activation with versionId - Extract versionId from workflow import response - Use POST /rest/workflows/{id}/activate with versionId - Workflow is now automatically activated after import Tested successfully on container sb-1769174647 --- libsupabase.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libsupabase.sh b/libsupabase.sh index 8d7e369..0fc89ee 100755 --- a/libsupabase.sh +++ b/libsupabase.sh @@ -743,18 +743,19 @@ WORKFLOW_RESP=\$(curl -sS -X POST "\${API_URL}/rest/workflows" \\ -d @/tmp/rag_workflow.json) WORKFLOW_ID=\$(echo "\$WORKFLOW_RESP" | grep -oP '"id"\s*:\s*"\K[^"]+' | head -1) +VERSION_ID=\$(echo "\$WORKFLOW_RESP" | grep -oP '"versionId"\s*:\s*"\K[^"]+' | head -1) if [ -z "\$WORKFLOW_ID" ]; then echo "WORKFLOW_IMPORT_FAILED: \$WORKFLOW_RESP" exit 1 fi -echo "Workflow imported: \$WORKFLOW_ID" +echo "Workflow imported: \$WORKFLOW_ID (version: \$VERSION_ID)" -# Activate workflow +# Activate workflow using POST /activate endpoint with versionId echo "Activating workflow..." -ACTIVATE_RESP=\$(curl -sS -X PATCH "\${API_URL}/rest/workflows/\${WORKFLOW_ID}" \\ +ACTIVATE_RESP=\$(curl -sS -X POST "\${API_URL}/rest/workflows/\${WORKFLOW_ID}/activate" \\ -H "Content-Type: application/json" \\ -b "\${COOKIE_FILE}" \\ - -d '{"active": true}') + -d "{\"versionId\":\"\${VERSION_ID}\"}") if echo "\$ACTIVATE_RESP" | grep -q '"active":true\|"active": true'; then echo "Workflow activated successfully"