Skip to content

docs: add Apify Actor run example task page - #5021

Draft
Jakub-Vacek wants to merge 4 commits into
triggerdotdev:mainfrom
apify:docs/735-actor-run-example-task-page
Draft

Jakub-Vacek wants to merge 4 commits into
triggerdotdev:mainfrom
apify:docs/735-actor-run-example-task-page

Conversation

@Jakub-Vacek

Copy link
Copy Markdown

Pre-agreed with the Trigger.dev team on Discord: https://discord.com/channels/1066956501299777596/1534928934184157205

✅ Checklist

  • I have followed every step in the contributing guide
  • The PR title follows the convention.
  • I ran and tested the code works

Testing

Both task samples were run against a live Apify account (only APIFY_TOKEN set) on Trigger.dev Cloud, dev environment, SDK 4.7.3, apify-client 2.25.0:

  • Example 1 (apify-actor-run): run completes and returns the dataset items from Website Content Crawler.
  • Example 2 (apify-long-actor-run): the run pauses on wait.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.
  • Aborted Actor run, both examples: aborting the Actor in Apify fails the task with AbortTaskRunError and does not retry.
  • apify-client bundling: without build.external: ["apify-client"], the first API call fails with TypeError: ProxyAgent is not a constructor. With it, both examples work. The page documents this.

Docs:

  • npx mintlify broken-links in docs/: no broken links found.
  • Ran the docs locally (npm run dev in docs/) 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:

  1. Start the Actor and wait for it to finish, for Actors that finish in seconds.
  2. Start the Actor with an Apify ad-hoc webhook pointing at a wait token URL, so the run pauses until the Actor finishes and the wait doesn't count towards compute.

The page imports the shared web scraping warning, and is linked from the example tasks table in docs/guides/introduction.mdx and the "Example tasks" group in docs/docs.json.


Screenshots

obrazek (1)

💯

@changeset-bot

changeset-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d40f824

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b6c030e2-3b2c-4718-9e86-afcfcd06215e


📥 Commits

Reviewing files that changed from the base of the PR and between d1e54bd and d40f824.



📒 Files selected for processing (1)
  • docs/guides/examples/apify-actor-run.mdx


🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/guides/examples/apify-actor-run.mdx


Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.




Walkthrough

The 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 d40f8

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 | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the primary change: adding an Apify Actor run example task page.
Description check Passed The description is mostly complete. It includes the checklist, testing details, changelog, and a screenshot, and it accurately describes the documentation changes. It does not include the template's r…

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Jakub-Vacek Jakub-Vacek changed the title Docs/735 actor run example task page Docs/Apify actor run example task page Oct 12, 2026
@Jakub-Vacek Jakub-Vacek changed the title Docs/Apify actor run example task page docs/apify actor run example task page Oct 12, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/guides/examples/apify-actor-run.mdx (1)

42-42: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use the specified TypeScript code-fence tag.

Change these four ts fences to typescript. As per coding guidelines, “Use language tags in code fences: typescript, bash, json.” The retrieved learning describes ts as 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
📥 Commits

Reviewing files that changed from the base of the PR and between 93465d8 and d1e54bd.

📒 Files selected for processing (3)
  • docs/docs.json
  • docs/guides/examples/apify-actor-run.mdx
  • docs/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.mdx
  • docs/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, {

@coderabbitai coderabbitai Bot Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

CC @daveomri this fells bit nitpicky - maybe we could left comment in code stating that this is example not production code

@daveomri daveomri Oct 12, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agreed, these examples aren't production code, but rather an example.

Added a note stating this fact (with proposed fix).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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!

@Jakub-Vacek Jakub-Vacek changed the title docs/apify actor run example task page docs: add Apify Actor run example task page Oct 12, 2026

This branch has not been deployed

No deployments
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.

2 participants