Repository navigation
feat(apify): add Apify lead research example - #153
Draft
Jakub-Vacek wants to merge 2 commits into
Draft
Jakub-Vacek wants to merge 2 commits into
Jakub-Vacek wants to merge 2 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
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.
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-actorstarts the Actor with an ad-hoc webhook on a wait token, so the run suspends until Apify calls back on any terminal event.maxTotalChargeUsdandmaxItemscap 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: achat.agentwith Apify Store search, input-schema, and run tools.runApifyActorhasneedsApproval: 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 thedatasetIdfor the rest.The README covers when to use each pattern, setup, and a sample payload per task.
Testing
Typechecked and built against
@trigger.dev/sdk4.7.3 andapify-client2.25.0, and every task ran against a live Apify account in dev:discover-leads(coffee roastery | Prague, Czechia) returned leads and fanned out toenrich-lead. Compute was 1.9 s of about 80 s, suspended onwait.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 withstatus: ABORTED.research-agentin 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