pollhook Setup
You are helping a user set up pollhook to bridge REST APIs into Continue's webhook system.
Prerequisites
- Go 1.22+ installed
- A Continue Mission Control workflow with a webhook trigger (you'll need the workflow ID)
- API credentials for the service(s) to poll
Step 1: Install pollhook
go install github.com/continuedev/pollhook@latest
Or build from source:
git clone https://github.com/continuedev/pollhook.git
cd pollhook
make build
Step 2: Create config file
Create a pollhook.yaml with one or more sources. Each source needs:
- name: Unique identifier
- command: Shell command that outputs JSON (run via
sh -c) - interval: How often to poll (Go duration:
30s,5m,1h) - items: Dot path to the JSON array (
"."for root,"data.incidents"for nested) - id: Dot path to the unique ID field on each item
- webhook.url: The Mission Control ingest endpoint (
https://hub.continue.dev/api/webhooks/ingest/<workflow-id>) - webhook.secret: Optional secret sent as
X-Webhook-Secretheader
Example for Sentry:
sources:
- name: sentry-issues
command: |
curl -s -H "Authorization: Bearer $SENTRY_TOKEN" \
https://sentry.io/api/0/projects/my-org/my-project/issues/?query=is:unresolved
interval: 5m
items: "."
id: "id"
webhook:
url: https://hub.continue.dev/api/webhooks/ingest/your-workflow-id
secret: your-webhook-secret
Environment variables ($SENTRY_TOKEN) are expanded in the config file.
Step 3: Test the config
Run a dry run to verify everything works:
pollhook test --config pollhook.yaml
This runs each command once, shows extracted items and what the webhook payloads would look like. No webhooks are sent and no state is touched.
Step 4: Run in production
pollhook serve --config pollhook.yaml
State is persisted to ~/.pollhook/state.json (customizable with --state-dir). The process handles SIGINT/SIGTERM gracefully.
For long-running deployment, use systemd, Docker, or a process manager:
# systemd example
pollhook serve --config /etc/pollhook/config.yaml --state-dir /var/lib/pollhook
Verification
pollhook versionprints a version stringpollhook test --config pollhook.yamlshows extracted items without errors- Check Mission Control for incoming webhook events after
pollhook servestarts
Troubleshooting
- "command timed out after 60s" — The API request is too slow. Check network connectivity or simplify the command.
- "extract items: expected array" — The
itemsdot path doesn't point to a JSON array. Usepollhook testto inspect the raw output and adjust the path. - "webhook returned 401" — The webhook secret doesn't match. Check the secret in your workflow configuration.
- "webhook returned 404" — The workflow ID in the URL is wrong. Verify it in Mission Control.
- Items not detected as new — pollhook deduplicates by ID. If the same IDs keep appearing, they've already been delivered. Delete
~/.pollhook/state.jsonto reset.
