Skip to content

docs: end-to-end Apify webhook example#176

Merged
bobakemamian merged 2 commits intomainfrom
docs/apify-webhook-example
Apr 21, 2026
Merged

docs: end-to-end Apify webhook example#176
bobakemamian merged 2 commits intomainfrom
docs/apify-webhook-example

Conversation

@bobakemamian
Copy link
Copy Markdown
Contributor

Captures the exact flow we validated against real Apify infrastructure on 2026-04-21 as a reference example under docs/examples/apify-webhook-scrape.md.

Covers:

  • Battery-backed Apify token
  • buttons webhook setup with cert.pem or --api-token paths (apex guard + zone-drift detection both noted)
  • Two buttons: apify-scrape-ig-post (fire + register callback) and apify-fetch-dataset (pull results)
  • One drawer on-apify-done with webhook trigger at /apify-done
  • `${inputs.webhook.body.resource.defaultDatasetId}` CEL resolution
  • Drawer-level retry policy for transient Apify 502s
  • Dry-run pattern via press --webhook-body without running the listener

Flags a gap: drawer NAME set on_failure.* isn't supported by the set verb yet — direct JSON edit is the current path. Worth a follow-up to extend service.SetField or add a dedicated retry verb.

🤖 Generated with Claude Code

bobakemamian and others added 2 commits April 21, 2026 10:22
Captures the exact flow validated against real Apify infrastructure on
2026-04-21: two buttons (scrape launcher + dataset fetcher) + one
drawer with webhook trigger. Real trip time: ~15s from press to
`[serve] drawer on-apify-done ok`.

Exercises the whole webhook surface in one walk-through:
  - batteries for the Apify token (globally scoped, stays out of repos)
  - `buttons webhook setup` with the cert.pem flow, apex guard, and
    zone-drift detection
  - alternative --api-token path for multi-zone / headless
  - `${inputs.webhook.body.resource.defaultDatasetId}` CEL resolution
  - auto-declared `webhook` input on trigger drawers
  - drawer-level retry policy on transient upstream 502s
  - listener drain + process-group kill on Ctrl-C
  - dry-run via `press --webhook-body` without running the listener

Flags a known gap: `drawer NAME set on_failure.*` is not yet wired;
direct JSON edit of drawer.json is the current path. Worth a follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Promotes the examples folder out of docs/ to the repo root so it's
discoverable alongside README/CLAUDE.md without spelunking into the
Mintlify docs tree. Both walk-throughs move:

- examples/apify-to-snowflake.md       (drawer composition reference)
- examples/apify-webhook-scrape.md     (just-added webhook reference)

Updates the single CLAUDE.md reference to the new paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bobakemamian bobakemamian merged commit 0c9cd05 into main Apr 21, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant