Skip to content

Infer record pickers for record-typed logic function workflow inputs#21494

Open
bosiraphael wants to merge 36 commits into
mainfrom
r--logic-function-record-inputs
Open

Infer record pickers for record-typed logic function workflow inputs#21494
bosiraphael wants to merge 36 commits into
mainfrom
r--logic-function-record-inputs

Conversation

@bosiraphael

@bosiraphael bosiraphael commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Context

Logic functions can declare workflow inputs typed as records or arrays of records (e.g. the People Data Labs enrichment functions), but the workflow builder rendered those as a plain text input with a variable picker, which is not usable.

What this does

  • Adds an objectUniversalIdentifier link on input schema properties, so a record-typed input is tied to a workspace object.
  • The SDK build infers it from a TwentyRecord<'objectUniversalIdentifier'> marker type in the handler signature, reading the object's universal identifier straight from the source; explicit input schemas can still set the field directly.
  • The workflow builder renders these inputs as a single record picker or a record multi-select with the variable picker on the right. Selected records are stored as record ids; TwentyRecord<UID> is a branded string, so the handler signature reflects that it receives ids (a bound variable resolves to whatever the referenced step produced).
  • The multi-select collapses overflowing chips into a +N badge (reusing ExpandableList) and its variable picker offers both record objects and fields.
  • Updates the People Data Labs enrichment inputs as the reference implementation.
CleanShot 2026-06-12 at 16 54 10@2x

Review in cubic

Add objectUniversalIdentifier to input schemas so logic function inputs
typed as workspace records (e.g. companies: Company[]) render as record
single/multi selects with a variable picker in the workflow builder.
Inference resolves inline handler types against standard and app objects
during the manifest build; explicit schemas can set the field directly.
Update the People Data Labs enrichment inputs as reference.
@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!

@twenty-ci-bot-public

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

Copy link
Copy Markdown

Visual Regression Report

✅ No visual changes detected across 225 stories.

@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.

4 issues found across 31 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/twenty-front/src/modules/logic-functions/hooks/useLogicFunctionForm.ts Outdated
@twenty-ci-bot-public

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

Copy link
Copy Markdown

Visual Regression Report (twenty-new-ui)

✅ No visual changes detected across 225 stories.

@twenty-ci-bot-public

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

Copy link
Copy Markdown

🔍 Automated Pre-Review

No issues detected - This PR is ready for human review.


View details

Automated pre-review — human approval still required.

@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 7 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/twenty-front/src/modules/logic-functions/hooks/useLogicFunctionForm.ts Outdated

@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 9 files (changes from recent commits).

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

Re-trigger cubic

Comment thread packages/twenty-shared/src/logic-function/get-input-schema-from-source-code.ts Outdated
…ord-inputs

# Conflicts:
#	packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx

@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 across 37 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/twenty-front/src/modules/logic-functions/hooks/useLogicFunctionForm.ts Outdated
@twenty-ci-bot-public

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

Copy link
Copy Markdown

Visual Regression Report (twenty-front)

  • 3 changed
  • 4 added
  • 666 unchanged
Changed stories
Story Diff %
modules-settings-accounts-blocklist-settingsaccountsblocklistinput--default 1%
modules-settings-accounts-blocklist-settingsaccountsblocklistsection--default 1%
modules-settings-playground-graphqlplayground--default 1%
4 new stories
  • ui-data-field-form-input-formmultirecordpicker--default
  • ui-data-field-form-input-formmultirecordpicker--readonly
  • ui-data-field-form-input-formmultirecordpicker--with-many-records
  • ui-data-field-form-input-formmultirecordpicker--with-variable

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.

3 participants