
Syncable Entity Runner And Actions
Contributing to the Twenty codebase itself (twentyhq/twenty server internals), not for...
Install
npx skills add twentyhq/twenty --skill syncable-entity-runner-and-actions -g -a claude-code -y- Repository
- twentyhq/twenty60.3k
- Category
- Data and ML
- Updated
- 3d ago
- License
- See repository
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
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.
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:
- Create action handler
- Update action handler
- Delete action handler
- Universal-to-flat conversion utilities
Key pattern: Each handler has two phases:
- Transpilation: Universal action → Flat action
- 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
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';
