GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — docs: add Apify Actor run example task page by Jakub-Vacek · Pull Request #5021 · triggerdotdev/trigger.dev ConversationPre-agreed with the Trigger.dev team on Discord: https://discord.com/channels/1066956501299777596/1534928934184157205 ✅ Checklist
TestingBoth task samples were run against a live Apify account (only
Docs:
ChangelogAdded an example task page,
The page imports the shared web scraping warning, and is linked from the example tasks table in Screenshots
💯
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. WalkthroughThe documentation adds an Apify Actor run guide and links it from the example-task navigation and introduction. The guide covers shared client setup, a short-run task that waits for results, and a long-run task that resumes through a webhook. It also includes dashboard testing instructions and notes about cancellation, retries, and task-output limits. Merge Risk:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| logger.info("Actor run finished", { runId: run.id, itemCount: items.length }); | ||
|
|
||
| return { runId: run.id, datasetId: run.defaultDatasetId, items }; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Large crawl results exceed task output limit
When a crawl returns over 10MB, apifyActorRun returns the items as task output. Trigger.dev rejects that output, so a successful Actor run ends in task failure; the webhook task has the same issue.
Both example tasks fetch dataset items and return them as one task result. Trigger.dev documents a 10MB task-output limit in task output limits. The webhook variant also returns the complete item array at apifyLongActorRun. An Actor can produce large text or structured records even with a 1,000-item cap, so the item count does not bound the serialized output size.
Example: A crawl returns 1,000 items averaging 12KB each. Apify reports success, but returning roughly 12MB as a task result exceeds the Trigger.dev output limit.
Recommended fix: In both examples, return the dataset ID and run ID rather than the entire dataset, or explicitly limit and measure the returned data and explain how to fetch larger results separately.
Was this helpful? React with 👍 or 👎 to provide feedback.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
added a note about the 10MB output limit and how to read large datasets
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Add `apify-client` to [`external`](/config/config-file#external) in your `trigger.config.ts` file. When it's bundled, `apify-client` fails on its first API call with `TypeError: ProxyAgent is not a constructor`. | ||
|
|
||
| ```ts trigger.config.ts |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟡 TypeScript examples violate required fence tags
All four TypeScript examples use ts fences instead of the required typescript tag in documentation rules.
The documentation rules require typescript for TypeScript code fences. Four fences in this page use ts, so fixing only the anchored fence leaves three violations.
Example: The config, shared client, synchronous task, and webhook task all open their code fences with ts.
Recommended fix: Change each of the four opening fences to typescript, keeping the file labels unchanged.
Was this helpful? React with 👍 or 👎 to provide feedback.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
keeping ts, because the site uses ts almost everywhere
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| throw new Error(`Actor run ${run.id} finished with status ${run.status}`); | ||
| } | ||
|
|
||
| const { items } = await apify.dataset(run.defaultDatasetId).listItems(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
listItems() without limit returns all items, and maxItems: 1000 bounds the dataset, so one call is complete
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| - The webhook covers all four ways an Actor run can end, so a failed, aborted or timed-out Actor resumes your run with an error instead of leaving it waiting until the token times out. | ||
| - `payloadTemplate` sends only `eventType` and `resource` (the Actor run). Whatever Apify posts to `token.url` becomes the token's result, so the `ApifyWebhookPayload` type matches this template, not Apify's default webhook payload. | ||
| - The token `timeout` is longer than the Actor's `timeout`, so the Actor always finishes, and the webhook fires, before the token expires. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Apify sends the webhook as soon as the run ends, so a 10-minute delay is unlikely. If it happens, the task retries, which the retry-safety note covers.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@isshaddad @D-K-P could one of you take a look when you have a moment? The review comments are addressed, and the checks pass. This is the Apify docs work agreed on in this Discord thread: https://discord.com/channels/1066956501299777596/1534928934184157205 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
At least 1 approving review is required to merge this pull request.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.