Skip to content

feat(apify): add Apify lead research example - #153

Draft
Jakub-Vacek wants to merge 2 commits into
triggerdotdev:mainfrom
apify:feat/737-apify-lead-research-example
Draft

Jakub-Vacek wants to merge 2 commits into
triggerdotdev:mainfrom
apify:feat/737-apify-lead-research-example

Conversation

@Jakub-Vacek

Copy link
Copy Markdown

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

What

A new example, apify-lead-research: a sales lead research desk that runs Apify Actors three ways.

  • discover-leads: scheduled Google Maps scrape. run-actor starts the Actor with an ad-hoc webhook on a wait token, so the run suspends until Apify calls back on any terminal event. maxTotalChargeUsd and maxItems cap spend, and an aborted run still returns the leads scraped so far.
  • enrich-lead: a blocking Website Content Crawler run (too short to bother suspending), then the model extracts contacts and a summary. A queue caps it at 2 crawls so it stays under the account memory limit.
  • research-agent: a chat.agent with Apify Store search, input-schema, and run tools. runApifyActor has needsApproval: true, and the Next.js UI (useTriggerChatTransport + useChat, Apify dark theme) shows Approve and Deny for every paid run. Output is trimmed for context, with the datasetId for the rest.

The README covers when to use each pattern, setup, and a sample payload per task.

Testing

Typechecked and built against @trigger.dev/sdk 4.7.3 and apify-client 2.25.0, and every task ran against a live Apify account in dev:

  • discover-leads (coffee roastery | Prague, Czechia) returned leads and fanned out to enrich-lead. Compute was 1.9 s of about 80 s, suspended on wait.forToken().
  • enrich-lead: 5 parallel runs returned emails, phones, and social profiles on the first attempt.
  • run-actor: aborting mid-run returned the partial dataset with status: ABORTED.
  • research-agent in the browser: approve, deny (the agent tried another approach), and all three suggested prompts completed.

Blocked by: triggerdotdev/trigger.dev#5021 and triggerdotdev/trigger.dev#5020

671370234-61c4d5a2-e492-457e-9cbf-1ad8de62d4ed

@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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.

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