Skip to content

feat: 122 zapier add Get Actor Run by ID search#151

Open
daveomri wants to merge 2 commits into
feat/zapier-improve-integration-for-zapier-agents-compatibilityfrom
feat/122-zapier-new-search-get-run-by-id
Open

feat: 122 zapier add Get Actor Run by ID search#151
daveomri wants to merge 2 commits into
feat/zapier-improve-integration-for-zapier-agents-compatibilityfrom
feat/122-zapier-new-search-get-run-by-id

Conversation

@daveomri

@daveomri daveomri commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

What & why

Part of #121 (Zapier Agents compatibility). Adds a Get Actor Run by ID search, the building block for async agent orchestration: Run Actor/Task returns a run ID, and this search later checks its status/retrieves output. The existing Find Last Actor Run only returns the most recent run, which is fragile with multiple concurrent runs.

Verified locally: mocked suite green, live API tested via zapier-platform invoke. Not yet tested in Zapier UI - blocked on push access (collaborator to admin request pending).

Changes

  • src/searches/get_run.js - GET /v2/actor-runs/{runId} via wrapRequestWithRetries; 404 → [] (miss = success, existing 'not found' convention); else enrichActorRun(...)[run] (inlined dataset items, KV OUTPUT, detailsPageUrl). Reuses ACTOR_RUN_SAMPLE + ACTOR_RUN_OUTPUT_FIELDS so output stays chainable (raw id, defaultDatasetId, etc. preserved).
  • src/output_fields.js - new getRunDatasetOutputFields: derives dynamic dataset columns from the run's own defaultDatasetId. The actor-based helper couldn't, since this search takes only runId (not actorId).
  • index.js - registered.
  • test/searches/get_run.js - 3 tests: found case, 404 → [], dynamic output fields.

Action metadata

Field Value
key getActorRunById
noun / label Actor Run / Get Actor Run by ID
description Retrieves details and results of a specific Actor run by its ID. Use to check status or fetch output of a run started in a previous step (via Run Actor or Run Task).

Input: runId (required, string; example ID in helpText).

Testing

  • Mocked: 63 passing / 8 pending / 0 failing. Lint clean. validate --without-style sound.
  • Live: existing run → enriched [run], missing run → [].
  • Pre-existing E2E failures (shape drift, token-scope) unrelated.

Notes

No renamed keys, no auth changes, no version/CHANGELOG edits. Targets epic branch.

@daveomri daveomri self-assigned this Jul 10, 2026
@daveomri daveomri changed the title feat: add "Get Actor Run by ID" search (#122) feat: 122 zapier add Get Actor Run by ID search Jul 14, 2026
@daveomri
daveomri requested review from drobnikj and protoss70 July 14, 2026 10:25
@daveomri
daveomri marked this pull request as ready for review July 14, 2026 10:25
@drobnikj
drobnikj requested review from JanHranicky and Copilot July 23, 2026 13:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Zapier Search action to retrieve and enrich an Apify Actor run by run ID, enabling more reliable async orchestration (e.g., “Run Actor/Task” → later “Get Actor Run by ID” to check status and fetch output) instead of relying on “last run” semantics.

Changes:

  • Introduces getActorRunById search (GET /v2/actor-runs/{runId}) and enriches the run with dataset items, KV OUTPUT, and a console details URL.
  • Adds a new dynamic output-fields helper that derives dataset fields from the run’s defaultDatasetId.
  • Registers the new search in index.js and adds mocked/E2E-capable tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/searches/get_run.js Implements the new “Get Actor Run by ID” search and run enrichment.
src/output_fields.js Adds getRunDatasetOutputFields to generate dynamic dataset item output fields based on runId.
index.js Registers the new search in the app’s searches map.
test/searches/get_run.js Adds tests for found/missing runs and dynamic output-fields behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/output_fields.js
Comment on lines +69 to +76
} catch (err) {
// 404 status = The run was not found.
if (err.status !== 404) {
z.console.error('Error while fetching run for output fields', err);
}
// Return default output fields, if the run does not exist or any other error.
return [];
}
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.

3 participants