/apify-pack:apify-webhooks-eventsfrom apify-pack
Configures Apify webhooks for Actor run notifications and event-driven scraping pipelines. Use for run completion alerts, ad-hoc webhooks, or persistent event subscriptions.
Ships in apify-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Configure webhooks to receive notifications when Actor runs complete, fail, or time out. Apify supports both persistent webhooks (for all runs of an Actor) and ad-hoc webhooks (for a single run). Event-driven architecture is the recommended pattern for production Apify integrations.
npm install apify-client in your project (and express if you build an HTTP handler)APIFY_TOKEN — read it from the environment
(process.env.APIFY_TOKEN) or pass Authorization: Bearer $APIFY_TOKEN on REST
calls, never hard-code itapify-sdk-patterns| Event | Fired When |
|---|---|
ACTOR.RUN.CREATED | A new Actor run starts |
ACTOR.RUN.SUCCEEDED | Run finishes with SUCCEEDED status |
ACTOR.RUN.FAILED | Run finishes with FAILED status |
ACTOR.RUN.ABORTED | Run is manually or programmatically aborted |
ACTOR.RUN.TIMED_OUT | Run exceeds its timeout |
ACTOR.RUN.RESURRECTED | A finished run is resurrected |
Persistent webhooks fire for every run of an Actor. Set condition.actorId, list
the eventTypes you care about, and shape the delivered body with
payloadTemplate:
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const webhook = await client.webhooks().create({
eventTypes: ['ACTOR.RUN.SUCCEEDED', 'ACTOR.RUN.FAILED', 'ACTOR.RUN.TIMED_OUT'],
condition: { actorId: 'YOUR_ACTOR_ID' },
requestUrl: 'https://your-app.com/api/webhooks/apify',
payloadTemplate: JSON.stringify({
eventType: '{{eventType}}',
actorRunId: '{{actorRunId}}',
defaultDatasetId: '{{resource.defaultDatasetId}}',
status: '{{resource.status}}',
statusMessage: '{{resource.statusMessage}}',
}),
isAdHoc: false,
});
console.log(`Webhook created: ${webhook.id}`);
The full payload template (all run fields) and the complete variable table are in payload templates & local testing.
Ad-hoc webhooks are created at run time and fire only for that specific run — pass
a webhooks array when starting the Actor:
const run = await client.actor('username/my-actor').start(
{ startUrls: [{ url: 'https://example.com' }] },
{
webhooks: [{
eventTypes: ['ACTOR.RUN.SUCCEEDED', 'ACTOR.RUN.FAILED'],
requestUrl: 'https://your-app.com/api/webhooks/apify',
}],
},
);
The equivalent REST/curl form is in payload templates & local testing.
Your endpoint must return a 2xx within 30 seconds, so acknowledge immediately and
process asynchronously. On SUCCEEDED, fetch the dataset via defaultDatasetId; on
FAILED/TIMED_OUT, pull the run log and alert:
app.post('/api/webhooks/apify', async (req, res) => {
res.status(200).json({ received: true }); // ack first
try {
await processWebhook(req.body); // switch on eventType, fetch dataset, alert
} catch (error) {
console.error('Webhook processing failed:', error);
}
});
The full processWebhook switch (dataset fetch, log tail, oncall alerting) is in
full implementation.
Apify may deliver a webhook more than once, so dedupe on
${actorRunId}:${eventType} before doing work. You can also chain Actors (Stage 1
SUCCEEDED → start Stage 2) and manage the webhook lifecycle (list, update,
delete, inspect dispatches). All three patterns — idempotent processing,
event-driven pipeline, and lifecycle management — are in
full implementation.
id (persistent webhooks are visible under
client.webhooks().list(); ad-hoc webhooks are scoped to one run)payloadTemplate JSON to your
requestUrlclient.webhook(id).dispatches().list() returns the delivery history — each entry
carries a status, createdAt, and the endpoint's responseStatus so you can
confirm delivery or diagnose retriescurl creation, and local testing with ngrok — payload templates & local testing| Issue | Cause | Solution |
|---|---|---|
| Webhook not delivered | URL unreachable | Verify HTTPS, check firewall |
| Duplicate processing | Webhook retry on non-2xx | Implement idempotency |
| Slow processing | Handler takes >30s | Respond 200 immediately, process async |
| Missing data in payload | Wrong template vars | Check template variable spelling |
| Webhook disabled | Too many failures | Re-enable in Console or via API |
For performance optimization, see apify-performance-tuning.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
18 skills in this plugin
/apify-ci-integrationConfigure CI/CD pipelines for Apify Actor builds and deployments.
Use when automating Actor deployment via GitHub Actions, running
integration tests against the live Apify API, or building CI/CD for
scrapers that push to the Apify platform.
Trigger with "apify CI", "apify GitHub Actions", "apify automated deploy",
"CI apify", "apify pipeline", "auto deploy actor".
/apify-common-errorsDiagnose and fix common Apify Actor and API errors.
Use when an Apify run fails, an API call returns 401/403/404/413/429,
a proxy connection drops, an Actor build breaks, or a scrape hits an
anti-bot block, and you need the cause plus a copy-paste fix.
Trigger with "apify error", "fix apify", "actor failed",
"apify not working", "debug apify", "apify 429".
/apify-core-workflow-aBuild a complete web scraping Actor with Crawlee and deploy to Apify.
Use when you need end-to-end web scraping on Apify: defining an input schema, building a router-based Crawlee crawler, extracting structured data, storing results in a dataset, testing locally, and deploying the Actor to the platform.
Trigger with "apify scrape website", "build apify actor", "crawlee scraper", "apify main workflow".
/apify-core-workflow-bManage Apify datasets, key-value stores, and request queues programmatically,
and orchestrate multi-Actor pipelines.
Use when you need to read or write Apify datasets, export scraped data to
CSV/JSON/XLSX, store config or binary artifacts in a key-value store, manage a
resumable request queue, chain Actors into a scrape → transform → export
pipeline, or monitor Actor run status and cost.
Trigger with "apify dataset", "apify key-value store", "apify storage",
"export apify data", "apify pipeline", "apify request queue".
/apify-cost-tuningOptimize Apify platform costs through memory tuning, compute unit management, and proxy budgeting. Use when analyzing Apify billing, reducing Actor run costs, or implementing usage monitoring and budget alerts. Trigger with "apify cost", "apify billing", "reduce apify costs", "apify pricing", "apify expensive", "apify budget", "compute units"./apify-debug-bundleCollect Apify debug evidence for support tickets and troubleshooting.
Use when an Actor run has failed, is stuck, or produced empty output and
you need to gather run metadata, logs, dataset samples, and environment
info before opening a support ticket.
Trigger with "apify debug", "apify support bundle", "collect apify logs",
"apify diagnostic", "apify run failed why".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin apify-packOther plugins' skills for the same job