Files
twenty/packages/twenty-apps/internal/twenty-linear
Félix Malfait 53fdac1417 feat(apps): split AI tool and workflow action triggers in LogicFunction manifest (#20208)
## Summary

Replaces the bolted-on `isTool` + `toolInputSchema` fields on
`LogicFunctionManifest` with two distinct, opt-in triggers that align
with the existing `cron` / `databaseEvent` / `httpRoute` trigger
pattern:

- **`toolTriggerSettings`** — exposes the function as an AI tool (chat /
MCP / function calling). Uses standard JSON Schema (the format LLMs
natively understand).
- **`workflowActionTriggerSettings`** — exposes the function as a step
in the visual workflow builder. Uses Twenty's rich `InputSchema` so the
builder can render proper `FieldMetadataType`-aware editors, variable
pickers, labels, and an optional `outputSchema`.

A function can opt into none, one, or both. Each surface gets the schema
format appropriate for it.

### Why

`isTool: true` previously exposed the function as both an AI tool AND a
workflow node, with the same JSON Schema feeding both — but the workflow
builder really wants Twenty's `InputSchema` (with `CURRENCY`,
`RELATION`, `EMAILS`, etc.) and the AI surface really wants standard
JSON Schema. Today the workflow builder hacks around this by treating
JSON Schema as `InputSchema`, which silently breaks for any
non-primitive field type. Splitting the triggers fixes that and lets
each surface evolve independently.

### Migration

- **Fast** instance command adds the two new nullable columns.
- **Slow** instance command backfills `toolTriggerSettings` +
`workflowActionTriggerSettings` from `isTool=true` rows (preserving
today's both-surfaces behaviour) then drops the legacy columns.

### Stacked

Stacked on top of #20181. Merge that first, then this.

## Test plan

- [ ] CI green (oxlint, typecheck, jest, vitest)
- [ ] Run `--include-slow` upgrade against a workspace with existing
`isTool=true` logic functions; verify both new columns populated and old
columns dropped
- [ ] Verify AI chat sees migrated tool functions (Linear create-issue,
Exa search) and can call them with the JSON Schema
- [ ] Add an AI-tool function from the Settings UI (toggles
`toolTriggerSettings`) and verify it shows up in chat
- [ ] Add a workflow-action function from the Settings UI (toggles
`workflowActionTriggerSettings`) and verify it appears in the workflow
node picker
- [ ] In the workflow builder, edit a `LOGIC_FUNCTION` step and verify
input fields render (no more JSON-Schema-as-InputSchema hack)
- [ ] Try defining a function with no triggers in the SDK and verify
`defineLogicFunction` rejects it

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: martmull <martmull@hotmail.fr>
2026-05-05 14:56:09 +02:00
..

Linear for Twenty

Connect your Linear account to Twenty to create issues and look up teams straight from your workflows or the AI chat.

What you can do

Once installed and connected, two tools become available:

  • Create Linear issue — from the AI chat, ask something like "create a Linear issue in the Engineering team titled 'Fix login bug'" and the AI will file it for you. From a workflow, add it as a step with teamId + title (and optional description).
  • List Linear teams — discovers the teams in your Linear workspace, useful when you need to pick a teamId for the create-issue step.

Installing

  1. Open Settings → Applications in your Twenty workspace.
  2. Find Linear in the available apps and click Install.
  3. Open the app, go to the Connections tab, and click Add connection.
  4. Choose Just for me (your personal Linear account) or Workspace shared (a team-managed Linear account anyone in this workspace can act through), then complete the Linear sign-in.

That's it — you can now use the tools above.

If you see a "Linear OAuth is not yet set up by your server administrator" notice on the Connections tab, ask your Twenty admin to follow the Self-hosting setup below — they need to provide the OAuth credentials before connections can be added.


Self-hosting setup

This section is for Twenty server admins. If you're on Twenty Cloud, skip this — the OAuth credentials are already configured.

1. Register an OAuth app in Linear

  1. Visit https://linear.app/settings/api/applications/new.
  2. Set the Redirect URI to <SERVER_URL>/apps/oauth/callback (for local dev: http://localhost:3000/apps/oauth/callback).
  3. Copy the generated Client ID and Client Secret.

2. Wire the credentials into Twenty

  1. In Settings → Applications, find Linear, click into it, and go to the Application registration tab (admin-only).
  2. Paste your Linear Client ID into LINEAR_CLIENT_ID and the Client Secret into LINEAR_CLIENT_SECRET.

Workspace users will now be able to add Linear connections from the Connections tab as described above.

3. (Developers only) Building the app from source

If you're working on this app rather than installing the published version:

cd packages/twenty-apps/internal/twenty-linear

# For day-to-day development (publish + install + watch in one):
yarn twenty dev

# Manual publish flow (deploy registers the app, install activates it):
yarn twenty deploy
yarn twenty install

twenty dev is recommended for iteration — it publishes, installs, and watches for changes in one command. Use twenty deploy + twenty install when you want to control each step separately (e.g. deploying to a production server without auto-installing).

This serves as the reference implementation for Twenty's defineConnectionProvider({ type: 'oauth' }) flow — useful as a template when adding OAuth integrations for other providers.