feat: 122 zapier add Get Actor Run by ID search#151
Open
daveomri wants to merge 2 commits into
Open
Conversation
daveomri
marked this pull request as ready for review
July 14, 2026 10:25
There was a problem hiding this comment.
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
getActorRunByIdsearch (GET /v2/actor-runs/{runId}) and enriches the run with dataset items, KVOUTPUT, 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.jsand 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 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 []; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Changes
src/searches/get_run.js-GET /v2/actor-runs/{runId}viawrapRequestWithRetries; 404 →[](miss = success, existing'not found'convention); elseenrichActorRun(...)→[run](inlined dataset items, KVOUTPUT,detailsPageUrl). ReusesACTOR_RUN_SAMPLE+ACTOR_RUN_OUTPUT_FIELDSso output stays chainable (rawid,defaultDatasetId, etc. preserved).src/output_fields.js- newgetRunDatasetOutputFields: derives dynamic dataset columns from the run's owndefaultDatasetId. The actor-based helper couldn't, since this search takes onlyrunId(notactorId).index.js- registered.test/searches/get_run.js- 3 tests: found case, 404 →[], dynamic output fields.Action metadata
Input:
runId(required, string; example ID in helpText).Testing
63 passing / 8 pending / 0 failing. Lint clean.validate --without-stylesound.[run], missing run →[].Notes
No renamed keys, no auth changes, no version/CHANGELOG edits. Targets epic branch.