Skip to content

Add People Data Labs enrichment logic functions#21254

Open
bosiraphael wants to merge 42 commits into
mainfrom
r--people-data-labs-enrichment-mapper
Open

Add People Data Labs enrichment logic functions#21254
bosiraphael wants to merge 42 commits into
mainfrom
r--people-data-labs-enrichment-mapper

Conversation

@bosiraphael

@bosiraphael bosiraphael commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Add People Data Labs enrichment logic functions

Implements the enrichment logic functions that call the PDL API and map responses onto standard + pdl* fields.

  • Logic functions — shared core powers bulk workflow actions (enrich-person / enrich-company) and single-record AI tools. Each guards a TTL, matches via identifier, fills standard fields only when empty, always writes pdl* fields, and normalizes SELECT values against field options.
  • Data model — PDL employer now links via the standard company relation (find-or-create, fill-only-if-empty); removed the dedicated pdlCurrentCompany relation, six pdlJobCompany* scalars, and the pdl* indexes.

Not functional yet: the post-install workflow seeding (seed-enrichment-workflow.ts) is left in place but blocked — it needs workflow-builder mutations that the CRUD-only app SDK schema doesn't expose.

Deferred: metering/billing and auto-enrichment triggers.

CleanShot.2026-06-10.at.18.33.48.mp4
CleanShot.2026-06-10.at.18.53.44.mp4

@twenty-ci-bot-public

Copy link
Copy Markdown

👋 Thanks for contributing to Twenty!

Your PR has been set to draft while you work on it. Once you're done, mark it as Ready for review and our automated checks will run.

Looking forward to your contribution!

@cubic-dev-ai cubic-dev-ai 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.

3 issues found across 139 files

Note: This PR contains a large number of files. cubic only reviews up to 100 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.

Re-trigger cubic

@twenty-ci-bot-public

twenty-ci-bot-public Bot commented Jun 5, 2026

Copy link
Copy Markdown

🔍 Automated Pre-Review

⚠️ Automated review could not complete — the author is a trusted contributor, treating as a warning only.


View details

Automated pre-review — human approval still required.

@bosiraphael bosiraphael changed the title Add People Data Labs enrichment logic functions [WIP] Add People Data Labs enrichment logic functions Jun 5, 2026

@cubic-dev-ai cubic-dev-ai 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.

2 issues found

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/twenty-apps/internal/people-data-labs/src/logic-functions/enrich-person.function.ts">

<violation number="1" location="packages/twenty-apps/internal/people-data-labs/src/logic-functions/enrich-person.function.ts:22">
P2: `records` schema is narrower than the actual bulk input contract, so valid string-id batches can be rejected before enrichment runs.</violation>
</file>

Note: This PR contains a large number of files. cubic only reviews up to 100 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.
Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 5 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants