Darian Vanceđ Executive Summary TL;DR: Connecting two Apify Actors in Zapier often fails because the...
TL;DR: Connecting two Apify Actors in Zapier often fails because the initial âRun Actorâ step provides a run ID and dataset ID (metadata) instead of the actual scraped data. To resolve this, users must explicitly fetch the dataset items using the âdefaultDatasetIdâ before passing them to the subsequent actor, ensuring the correct data payload is received.
Struggling to chain Apify Actors in Zapier? Discover why simply passing a run ID fails and learn three distinct solutions, from a quick fix to a robust architectural pattern, to get your data flowing correctly.
I remember this one time, about 3 AM, staring at a failing deployment pipeline. We had a simple job: a microservice that processed images (letâs call it image-proc-svc) was supposed to hand off a JSON payload with image URLs to another service (metadata-enrich-svc). It worked perfectly in staging. In production? Silence. The logs for metadata-enrich-svc were bone dry. After two hours of tearing my hair out, I found it. The image-proc-svc was sending a JSON object containing a jobId, but the enrichment service was expecting an array of urls. It was a classic âyou sent me the box, not the stuff inside the boxâ problem. The system wasnât broken; my assumptions were.
Thatâs the exact same feeling I get when I see folks struggling to connect two Apify Actors in Zapier. It feels like it should âjust work,â but it fails silently, leaving you wondering what you did wrong. You didnât do anything wrong. You just misunderstood what kind of box Apify is handing to Zapier.
Hereâs the fundamental issue. When you use the âRun Actorâ action in Zapier for your first Apify Actor (letâs call it Actor A), the immediate output from that step is not the data it scraped. Itâs a summary of the run itself. Think of it as a receipt. It has details like the runId, status, startTime, and, crucially, the defaultDatasetId.
Your second Apify Actor (Actor B) doesnât know what to do with a runId. Itâs expecting data to work onâa list of URLs, some text, a JSON object. When you map the runId from Actor A into the input of Actor B, youâre handing it the receipt and asking it to cook dinner. Itâs not going to work.
Hereâs a simplified look at the JSON output from a âRun Actorâ step:
{
"id": "abCDeF12345", // This is the Run ID (the "receipt")
"actId": "my-cool-scraper",
"status": "SUCCEEDED",
"defaultDatasetId": "zyXWvU98765", // This is the ID for the data (the "groceries")
"containerUrl": "https://console.apify.com/..."
// ...and other metadata
}
The goal is to get the data from the defaultDatasetId and pass that to your second actor. So, how do we do it? We have a few options, ranging from âquick and dirtyâ to âarchitecturally sound.â
This is the fastest way to get things working, but it can be a bit brittle. Some Apify Actors are smart enough to accept a Dataset ID as their input. Instead of giving it the raw data, you just tell it where to find the data on the Apify platform.
Steps:
For an actor that accepts a dataset ID in its JSON input, you would map it like this:
{
"sourceDatasetId": "zyXWvU98765" // Mapped from Actor A's output
}
Darianâs Take: I call this the duct tape method because it relies on Actor B being specifically designed to accept a
datasetId. If itâs not, this will fail. Itâs a handy shortcut for actors designed to work in a chain, but itâs not a universal solution. Use it when you need a result now.
This is the most reliable and explicit method within the standard Zapier workflow. It involves adding an extra step to explicitly fetch the results from the first run before passing them to the second.
Steps:
url, title, etc.) from the dataset into Actor Bâs input.This flow is unambiguous: Run Job -> Get Jobâs Data -> Use Data in Next Job.
Heads Up: This method uses one extra Zapier task per run, which can affect your monthly bill. For low-volume workflows, itâs a non-issue. For high-volume, see the next solution. But for clarity and maintainability, this is my default recommendation.
Sometimes, you donât want Zapier polling and waiting for an Apify run to finish. This is slow and inefficient. The professional-grade solution is to reverse the logic: have Apify tell Zapier when the first job is done.
This uses Apify Webhooks and Zapierâs âCatch Hookâ trigger.
| Pro | Con |
| Instantaneous. The second actor runs the moment the first one succeeds. | More complex to set up. Requires understanding webhooks. |
| More efficient. Uses fewer Zapier tasks as thereâs no âwaitingâ step. | Harder to debug if the webhook fails to fire or the payload is wrong. |
High-Level Steps:
resource.defaultDatasetId.This turns your workflow from a âpullâ model (Zapier checking on Apify) to a âpushâ model (Apify telling Zapier). Itâs how we build our internal event-driven systems at TechResolve, and itâs the most scalable solution by far.
So, next time youâre stuck, remember my 3 AM debugging session. Are you handing over the box, or the stuff inside? Making that distinction is the key to unlocking these powerful automation workflows.
đ Read the original article on TechResolve.blog
â Support my work
If this article helped you, you can buy me a coffee: