Repository navigation
docs: add Apify Actor run example task page - #5021
Jakub-Vacek wants to merge 4 commits into
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe documentation adds an Apify Actor run guide and links it from the example-task navigation. It covers shared client setup, a short-run task that waits for results, and a long-run task that resumes through a webhook. The guide also includes test instructions, cancellation guidance, and links to related documentation. Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to A retry can start an additional Apify Actor run. The guide warns readers, but the examples should be made retry-safe before merge unless that limitation is explicitly accepted. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/guides/examples/apify-actor-run.mdx (1)
42-42: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse the specified TypeScript code-fence tag.
Change these four
tsfences totypescript. As per coding guidelines, “Use language tags in code fences:typescript,bash,json.” The retrieved learning describestsas the existing site convention, but the supplied coding guideline takes precedence.Also applies to: 58-58, 86-86, 148-148
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c1c04ff7-9479-418d-acf4-4c8bb7ab3d07
📒 Files selected for processing (3)
docs/docs.jsondocs/guides/examples/apify-actor-run.mdxdocs/guides/introduction.mdx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
📜 Review details
🧰 Additional context used
📚 Code guidelines (1)
docs/CLAUDE.md — auto-discovered
📓 Path-based instructions (1)
Source excerpt: Use these components for structured content: Source excerpt: Always import from `@trigger.dev/sdk` (never `@trigger.dev/sdk/v3`) Source excerpt: Make code examples complete and runnable where possible Source excerpt: Use lan...
📄 CodeRabbit inference engine (docs/CLAUDE.md)
Files:
docs/guides/introduction.mdxdocs/guides/examples/apify-actor-run.mdx
🧠 Learnings (1)
📚 Learning: 2026-04-30T20:30:29.458Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3226
File: docs/ai-chat/quick-start.mdx:13-13
Timestamp: 2026-04-30T20:30:29.458Z
Learning: In this repo’s documentation MDX files (`docs/**/*.mdx`), use `ts` and `tsx` (not `typescript`) as the code-fence language tags for TypeScript/TSX snippets. Do not flag `ts`/`tsx` code-fence language tags as incorrect in any docs MDX file, since this is the site-wide Mintlify-compatible convention.
Applied to files:
docs/guides/examples/apify-actor-run.mdx
| maxDuration: 600, | ||
| retry: { maxAttempts: 3 }, | ||
| run: async (payload: { actorId: string; input: Record<string, unknown> }) => { | ||
| const run = await apify.actor(payload.actorId).call(payload.input, { |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
Make Actor starts retry-safe. Both tasks can start a second Actor when an attempt fails after the first Actor starts. In the short task, waitSecs can expire while the Actor remains READY or RUNNING. In the long task, the webhook wait or dataset request can fail after start() succeeds. Persist the Actor run ID across attempts and resume or reconcile that run before starting another. (docs.apify.com)
docs/guides/examples/apify-actor-run.mdx#L95-L95: resume or stop an unfinished Actor before a retry can call it again.docs/guides/examples/apify-actor-run.mdx#L164-L164: reuse the previously started Actor run when a later step fails.
📍 Affects 1 file
docs/guides/examples/apify-actor-run.mdx#L95-L95(this comment)docs/guides/examples/apify-actor-run.mdx#L164-L164
There was a problem hiding this comment.
CC @daveomri this fells bit nitpicky - maybe we could left comment in code stating that this is example not production code
There was a problem hiding this comment.
Agreed, these examples aren't production code, but rather an example.
Added a note stating this fact (with proposed fix).
There was a problem hiding this comment.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
Pre-agreed with the Trigger.dev team on Discord: https://discord.com/channels/1066956501299777596/1534928934184157205
✅ Checklist
Testing
Both task samples were run against a live Apify account (only
APIFY_TOKENset) on Trigger.dev Cloud, dev environment, SDK 4.7.3,apify-client2.25.0:apify-actor-run): run completes and returns the dataset items from Website Content Crawler.apify-long-actor-run): the run pauses onwait.forToken()while the Actor works (about 2 s of compute out of about 21 s total), resumes on the Apify webhook and returns the dataset items.AbortTaskRunErrorand does not retry.apify-clientbundling: withoutbuild.external: ["apify-client"], the first API call fails withTypeError: ProxyAgent is not a constructor. With it, both examples work. The page documents this.Docs:
npx mintlify broken-linksindocs/: no broken links found.npm run devindocs/) and checked the new page, the sidebar entry under "Example tasks", the row in the example tasks table and the in-page links.Changelog
Added an example task page,
docs/guides/examples/apify-actor-run.mdx, showing two ways to run an Apify Actor from a task:The page imports the shared web scraping warning, and is linked from the example tasks table in
docs/guides/introduction.mdxand the "Example tasks" group indocs/docs.json.Screenshots
💯