# Syncable Entity Runner And Actions

Contributing to the Twenty codebase itself (twentyhq/twenty server internals), not for...

- Repository: https://github.com/twentyhq/twenty (60258 stars)
- Category: Data and ML
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add twentyhq/twenty --skill syncable-entity-runner-and-actions -g -a claude-code -y`
Codex: `npx skills add twentyhq/twenty --skill syncable-entity-runner-and-actions -g -a codex -y`
Cursor: `npx skills add twentyhq/twenty --skill syncable-entity-runner-and-actions -g -a cursor -y`
Gemini CLI: `npx skills add twentyhq/twenty --skill syncable-entity-runner-and-actions -g -a gemini-cli -y`

## Description

Contributing to the Twenty codebase itself (twentyhq/twenty server internals), not for building apps on top of Twenty. Implement action handlers for executing workspace migrations in Twenty. Use when creating database operations for syncable entities, implementing universal-to-flat entity transpilation, or handling create/update/delete actions in the runner layer.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Syncable Entity: Runner & Actions (Step 4/6)

**Purpose**: Execute migration actions against the database with proper transpilation from universal to flat entities.

**When to use**: After completing Steps 1-3 (Types, Cache, Builder). Required before integration.

---

## Quick Start

This step creates:
1. Create action handler
2. Update action handler
3. Delete action handler
4. Universal-to-flat conversion utilities

**Key pattern**: Each handler has two phases:
1. **Transpilation**: Universal action → Flat action
2. **Execution**: Flat action → Database operation

---

## Step 1: Create Action Handler

**File**: `src/engine/workspace-manager/workspace-migration/workspace-migration-runner/action-handlers/my-entity/services/create-my-entity-action-handler.service.ts`

```typescript
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';

import { WorkspaceCreateActionHandlerService } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-runner/action-handlers/workspace-create-action-handler.service';
import { MyEntityEntity } from 'src/engine/metadata-modules/my-entity/entities/my-entity.entity';
import { fromUniversalFlatMyEntityToFlatMyEntity } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-runner/action-handlers/my-entity/utils/from-universal-flat-my-entity-to-flat-my-entity.util';
import {
  type UniversalCreateMyEntityAction,
  type FlatCreateMyEntityAction,
} from 'src/engine/workspace-manager/workspace-migration/workspace-migration-builder/builders/my-entity/types/workspace-migration-my-entity-action.type';

The rest: https://github.com/twentyhq/twenty/blob/HEAD/.claude/skills/syncable-entity-runner-and-actions/SKILL.md
