# Path to the SQLite database file. Defaults to dev.db next to this file.
DATABASE_PATH=./dev.db

# Where uploaded flow files are stored. Defaults to ./uploads next to this file.
UPLOAD_DIR=./uploads

# Webhook that returns individual flow runs (one entry per execution).
# Expected shape (flat array):
# [ { "executionId": "1601940", "workflowId": "...", "workflowName": "...", "status": "success" } ]
# status is one of: success | failed | running | pending
# startedAt/finishedAt are optional ISO8601 strings; if omitted they are
# inferred from poll timestamps (see services/normalize.py).
WEBHOOK_EXECUTIONS_URL=https://n8n.tplift.ir/webhook/Executions

# Webhook that returns the full list of workflows.
# Shape: [{"total": N, "workflows": [{"id": "...", "name": "...", "active": true}]}]
# "active" is optional; if present it becomes the source of truth for the
# Active/Deactivate button state.
WEBHOOK_FLOWS_URL=https://n8n.tplift.ir/webhook/FLOWS

# Webhook used to fetch a single execution's log by executionId (POST {executionId}).
WEBHOOK_LOG_URL=https://n8n.tplift.ir/webhook/log

# Webhook called when the user clicks Active/Deactivate on a flow's page.
# POST { "flowId": "...", "action": "activate" | "deactivate" }. Any 2xx = success.
WEBHOOK_FLOW_TOGGLE_URL=https://n8n.tplift.ir/webhook/active/deactive

# Shared secret for POST /api/internal/poll and /api/internal/refresh-flows —
# point an OS-level cron job (cPanel Cron Jobs) at these instead of relying on
# a background thread, since Passenger WSGI processes are request-driven and
# may be recycled between requests.
INTERNAL_TRIGGER_SECRET=

# Set to "1" to also run a lightweight background polling thread when this
# app is launched directly with `python app.py` (local/dev convenience only —
# NOT used when running under passenger_wsgi.py in production).
ENABLE_BACKGROUND_THREAD=1
EXECUTIONS_POLL_SECONDS=60
FLOWS_REFRESH_SECONDS=86400
