From apify-pack
Manage Apify datasets, key-value stores, and request queues programmatically, and orchestrate multi-Actor pipelines with export and monitoring.
How this skill is triggered — by the user, by Claude, or both
Slash command
/apify-pack:apify-core-workflow-bThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Manage Apify's three storage types (datasets, key-value stores, request queues)
Manage Apify's three storage types (datasets, key-value stores, request queues)
and orchestrate multi-Actor pipelines using the apify-client JS SDK. Covers
CRUD operations, data export, automatic pagination, and chaining Actors
together (scrape → transform → export).
This SKILL.md gives you the high-level workflow plus the essential first example for each storage type. Drill into the reference files for the complete, copy-ready code:
apify-client installed (npm install apify-client).APIFY_TOKEN (see Authentication below).apify-core-workflow-a (Actor invocation and run lifecycle),
since pipelines chain Actor runs and read their default storages.All operations authenticate with an Apify API token. Never hard-code it — read it from the environment and construct the client once:
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
Generate a token at Apify Console → Settings → Integrations, then export it
(export APIFY_TOKEN=apify_api_...) or load it from your secrets manager.
| Storage | Best For | Analogy | Retention |
|---|---|---|---|
| Dataset | Lists of similar items (products, pages) | Append-only table | 7 days (unnamed) |
| Key-Value Store | Config, screenshots, summaries, any file | S3 bucket | 7 days (unnamed) |
| Request Queue | URLs to crawl (managed by Crawlee) | Job queue | 7 days (unnamed) |
Named storages persist indefinitely. Unnamed (default run) storages expire after 7 days.
Pick the storage type you need, use the skeleton below to get started, then open the linked reference for the full operation set.
getOrCreate a named dataset, push items, and list them (pagination is manual):
const dataset = await client.datasets().getOrCreate('product-catalog');
const dsClient = client.dataset(dataset.id);
await dsClient.pushItems([{ sku: 'ABC123', name: 'Widget', price: 9.99 }]);
const { items, total } = await dsClient.listItems({ limit: 100, offset: 0 });
Full auto-pagination loop, CSV/JSON/XLSX export, and field filtering: storage-operations.md, Step 1.
Store JSON or binary records by key, then retrieve them:
const store = await client.keyValueStores().getOrCreate('scraper-config');
const kvClient = client.keyValueStore(store.id);
await kvClient.setRecord({ key: 'settings', value: { maxRetries: 3 }, contentType: 'application/json' });
const record = await kvClient.getRecord('settings');
Binary records, key listing, and reading a run's default OUTPUT:
storage-operations.md, Step 2.
Create a named queue and add requests (deduplicated by uniqueKey):
const queue = await client.requestQueues().getOrCreate('my-crawl-queue');
const rqClient = client.requestQueue(queue.id);
await rqClient.addRequest({ url: 'https://example.com/page1', uniqueKey: 'page1' });
Batch adds and queue stats: storage-operations.md, Step 3.
Chain Actors (scrape → transform → export) and monitor run status and cost.
Full runPipeline() function and run-monitoring code:
pipelines.md.
{ items, total, count, offset, limit } from listItems();
downloadItems(format) returns a Buffer in csv / json / xlsx.{ key, value, contentType } from getRecord()
and { items } (each { key, size }) from listKeys().{ pendingRequestCount, handledRequestCount, ... }
from get().{ status, statusMessage, stats, usage, usageTotalUsd } per run.| Error | Cause | Solution |
|---|---|---|
Dataset not found | Expired (unnamed, >7 days) | Use named datasets for persistence |
Record too large | KV store 9MB record limit | Split into multiple records |
Push failed | Dataset items >9MB batch | Push in smaller batches |
Request already exists | Duplicate uniqueKey | Expected behavior, queue deduplicates |
Export a named dataset to CSV — get the client, download the buffer, write it:
const csvBuffer = await client.dataset('product-catalog').downloadItems('csv');
require('fs').writeFileSync('products.csv', csvBuffer);
Read an Actor run's OUTPUT record — after a run completes:
const run = await client.actor('apify/web-scraper').call(input);
const output = await client.keyValueStore(run.defaultKeyValueStoreId).getRecord('OUTPUT');
Longer end-to-end examples — the full pagination loop, binary record storage,
and the three-stage runPipeline() — live in the reference files:
storage-operations.md and
pipelines.md.
For common errors and their fixes across the Apify pack, see the
apify-common-errors skill. For Actor invocation and run lifecycle basics that
pipelines build on, see apify-core-workflow-a.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin apify-packRuns an Apify Actor, waits for completion, and retrieves scraped data via apify-client. Demonstrates the core call-wait-collect pattern for Apify integrations.
Integrates Apify Actors into JS/TS or Python apps via the apify-client package. Covers sync/async execution, dataset retrieval, and Actor discovery for web scraping and automation.
Guides development and debugging of Apify Actor projects: CLI setup, authentication, input/output wiring, and runtime logic.