diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/hooks/useFormattedJsonFieldValue.ts b/packages/twenty-front/src/modules/object-record/record-field/meta-types/hooks/useFormattedJsonFieldValue.ts index 44a0365b4..536559ccd 100644 --- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/hooks/useFormattedJsonFieldValue.ts +++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/hooks/useFormattedJsonFieldValue.ts @@ -1,6 +1,6 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular'; import { FieldContext } from '@/object-record/record-field/contexts/FieldContext'; -import { orderWorkflowRunOutput } from '@/object-record/record-field/meta-types/utils/orderWorkflowRunOutput'; +import { orderWorkflowRunState } from '@/object-record/record-field/meta-types/utils/orderWorkflowRunState'; import { FieldJsonValue } from '@/object-record/record-field/types/FieldMetadata'; import { useContext } from 'react'; import { isDefined } from 'twenty-shared/utils'; @@ -15,10 +15,10 @@ export const useFormattedJsonFieldValue = ({ if ( fieldDefinition.metadata.objectMetadataNameSingular === CoreObjectNameSingular.WorkflowRun && - fieldDefinition.metadata.fieldName === 'output' && + fieldDefinition.metadata.fieldName === 'state' && isDefined(fieldValue) ) { - return orderWorkflowRunOutput(fieldValue) as FieldJsonValue; + return orderWorkflowRunState(fieldValue) as FieldJsonValue; } return fieldValue; diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/hooks/usePrecomputedJsonDraftValue.ts b/packages/twenty-front/src/modules/object-record/record-field/meta-types/hooks/usePrecomputedJsonDraftValue.ts index 251d60e8f..ee32c3fc3 100644 --- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/hooks/usePrecomputedJsonDraftValue.ts +++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/hooks/usePrecomputedJsonDraftValue.ts @@ -1,6 +1,6 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular'; import { FieldContext } from '@/object-record/record-field/contexts/FieldContext'; -import { orderWorkflowRunOutput } from '@/object-record/record-field/meta-types/utils/orderWorkflowRunOutput'; +import { orderWorkflowRunState } from '@/object-record/record-field/meta-types/utils/orderWorkflowRunState'; import { useContext } from 'react'; import { isDefined, parseJson } from 'twenty-shared/utils'; import { JsonObject, JsonValue } from 'type-fest'; @@ -19,10 +19,10 @@ export const usePrecomputedJsonDraftValue = ({ if ( fieldDefinition.metadata.objectMetadataNameSingular === CoreObjectNameSingular.WorkflowRun && - fieldDefinition.metadata.fieldName === 'output' && + fieldDefinition.metadata.fieldName === 'state' && isDefined(draftValue) ) { - return orderWorkflowRunOutput(parsedJsonValue) as JsonObject; + return orderWorkflowRunState(parsedJsonValue) as JsonObject; } return parsedJsonValue; diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/utils/isWorkflowRunJsonField.ts b/packages/twenty-front/src/modules/object-record/record-field/meta-types/utils/isWorkflowRunJsonField.ts index c4556aa1a..6ca35e439 100644 --- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/utils/isWorkflowRunJsonField.ts +++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/utils/isWorkflowRunJsonField.ts @@ -10,6 +10,6 @@ export const isWorkflowRunJsonField = ({ }) => { return ( objectMetadataNameSingular === CoreObjectNameSingular.WorkflowRun && - (fieldName === 'output' || fieldName === 'context') + fieldName === 'state' ); }; diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/utils/orderWorkflowRunOutput.ts b/packages/twenty-front/src/modules/object-record/record-field/meta-types/utils/orderWorkflowRunOutput.ts deleted file mode 100644 index 77ce4deb5..000000000 --- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/utils/orderWorkflowRunOutput.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { WorkflowRunOutput } from '@/workflow/types/Workflow'; -import { workflowRunOutputSchema } from '@/workflow/validation-schemas/workflowSchema'; -import { isDefined } from 'twenty-shared/utils'; -import { JsonValue } from 'type-fest'; - -export const orderWorkflowRunOutput = (value: JsonValue) => { - const parsedValue = workflowRunOutputSchema.safeParse(value); - if (!parsedValue.success) { - return null; - } - - const orderedWorkflowRunOutput: WorkflowRunOutput = { - ...(isDefined(parsedValue.data.error) - ? { - error: parsedValue.data.error, - } - : {}), - ...(isDefined(parsedValue.data.stepsOutput) - ? { - stepsOutput: parsedValue.data.stepsOutput, - } - : {}), - flow: parsedValue.data.flow, - }; - - return orderedWorkflowRunOutput; -}; diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/utils/orderWorkflowRunState.ts b/packages/twenty-front/src/modules/object-record/record-field/meta-types/utils/orderWorkflowRunState.ts new file mode 100644 index 000000000..8c5dbc6f4 --- /dev/null +++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/utils/orderWorkflowRunState.ts @@ -0,0 +1,23 @@ +import { WorkflowRunState } from '@/workflow/types/Workflow'; +import { workflowRunStateSchema } from '@/workflow/validation-schemas/workflowSchema'; +import { isDefined } from 'twenty-shared/utils'; +import { JsonValue } from 'type-fest'; + +export const orderWorkflowRunState = (value: JsonValue) => { + const parsedValue = workflowRunStateSchema.safeParse(value); + if (!parsedValue.success) { + return null; + } + + const orderedWorkflowRunState: WorkflowRunState = { + ...(isDefined(parsedValue.data.workflowRunError) + ? { + workflowRunError: parsedValue.data.workflowRunError, + } + : {}), + stepInfos: parsedValue.data.stepInfos, + flow: parsedValue.data.flow, + }; + + return orderedWorkflowRunState; +}; diff --git a/packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowVersion.tsx b/packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowVersion.tsx index 235b71f31..84652a451 100644 --- a/packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowVersion.tsx +++ b/packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowVersion.tsx @@ -80,8 +80,6 @@ export const useRunWorkflowVersion = () => { const recordInput: Partial = { name: '#0', status: 'NOT_STARTED', - output: null, - context: null, workflowVersionId, workflowId, createdAt: new Date().toISOString(), diff --git a/packages/twenty-front/src/modules/workflow/types/Workflow.ts b/packages/twenty-front/src/modules/workflow/types/Workflow.ts index 5b8caea29..c8c3ae907 100644 --- a/packages/twenty-front/src/modules/workflow/types/Workflow.ts +++ b/packages/twenty-front/src/modules/workflow/types/Workflow.ts @@ -1,63 +1,26 @@ import { workflowAiAgentActionSchema, - workflowAiAgentActionSettingsSchema, workflowCodeActionSchema, - workflowCodeActionSettingsSchema, workflowCreateRecordActionSchema, - workflowCreateRecordActionSettingsSchema, workflowCronTriggerSchema, workflowDatabaseEventTriggerSchema, workflowDeleteRecordActionSchema, - workflowDeleteRecordActionSettingsSchema, - workflowExecutorOutputSchema, workflowFilterActionSchema, - workflowFilterActionSettingsSchema, workflowFindRecordsActionSchema, - workflowFindRecordsActionSettingsSchema, workflowFormActionSchema, - workflowFormActionSettingsSchema, workflowHttpRequestActionSchema, workflowManualTriggerSchema, - workflowRunOutputSchema, - workflowRunOutputStepsOutputSchema, workflowRunSchema, workflowRunStateSchema, workflowRunStatusSchema, workflowRunStepStatusSchema, workflowSendEmailActionSchema, - workflowSendEmailActionSettingsSchema, workflowTriggerSchema, workflowUpdateRecordActionSchema, - workflowUpdateRecordActionSettingsSchema, workflowWebhookTriggerSchema, } from '@/workflow/validation-schemas/workflowSchema'; import { z } from 'zod'; -export type WorkflowCodeActionSettings = z.infer< - typeof workflowCodeActionSettingsSchema ->; -export type WorkflowSendEmailActionSettings = z.infer< - typeof workflowSendEmailActionSettingsSchema ->; -export type WorkflowCreateRecordActionSettings = z.infer< - typeof workflowCreateRecordActionSettingsSchema ->; -export type WorkflowUpdateRecordActionSettings = z.infer< - typeof workflowUpdateRecordActionSettingsSchema ->; -export type WorkflowDeleteRecordActionSettings = z.infer< - typeof workflowDeleteRecordActionSettingsSchema ->; -export type WorkflowFindRecordsActionSettings = z.infer< - typeof workflowFindRecordsActionSettingsSchema ->; -export type WorkflowFilterActionSettings = z.infer< - typeof workflowFilterActionSettingsSchema ->; -export type WorkflowFormActionSettings = z.infer< - typeof workflowFormActionSettingsSchema ->; - export type WorkflowCodeAction = z.infer; export type WorkflowSendEmailAction = z.infer< typeof workflowSendEmailActionSchema @@ -80,10 +43,6 @@ export type WorkflowHttpRequestAction = z.infer< typeof workflowHttpRequestActionSchema >; -export type WorkflowAiAgentActionSettings = z.infer< - typeof workflowAiAgentActionSettingsSchema ->; - export type WorkflowAiAgentAction = z.infer; export type WorkflowAction = @@ -143,14 +102,6 @@ export type ManualTriggerWorkflowVersion = WorkflowVersion & { trigger: WorkflowManualTrigger | null; }; -export type WorkflowRunOutput = z.infer; -export type WorkflowExecutorOutput = z.infer< - typeof workflowExecutorOutputSchema ->; -export type WorkflowRunOutputStepsOutput = z.infer< - typeof workflowRunOutputStepsOutputSchema ->; - export type WorkflowRunStatus = z.infer; export type WorkflowRun = z.infer; diff --git a/packages/twenty-front/src/modules/workflow/validation-schemas/workflowSchema.ts b/packages/twenty-front/src/modules/workflow/validation-schemas/workflowSchema.ts index 8b68d442e..18788442c 100644 --- a/packages/twenty-front/src/modules/workflow/validation-schemas/workflowSchema.ts +++ b/packages/twenty-front/src/modules/workflow/validation-schemas/workflowSchema.ts @@ -297,27 +297,6 @@ export const workflowTriggerSchema = z.discriminatedUnion('type', [ workflowWebhookTriggerSchema, ]); -// Step output schemas -export const workflowExecutorOutputSchema = z.object({ - result: z.any().optional(), - error: z.any().optional(), - pendingEvent: z.boolean().optional(), -}); - -export const workflowRunOutputStepsOutputSchema = z.record( - workflowExecutorOutputSchema, -); - -// Final workflow run output schema -export const workflowRunOutputSchema = z.object({ - flow: z.object({ - trigger: workflowTriggerSchema, - steps: z.array(workflowActionSchema), - }), - stepsOutput: workflowRunOutputStepsOutputSchema.optional(), - error: z.any().optional(), -}); - export const workflowRunStepStatusSchema = z.nativeEnum(StepStatus); export const workflowRunStateStepInfoSchema = z.object({ @@ -339,8 +318,6 @@ export const workflowRunStateSchema = z.object({ workflowRunError: z.any().optional(), }); -export const workflowRunContextSchema = z.record(z.any()); - export const workflowRunStatusSchema = z.enum([ 'NOT_STARTED', 'RUNNING', @@ -355,8 +332,6 @@ export const workflowRunSchema = z id: z.string(), workflowVersionId: z.string(), workflowId: z.string(), - output: workflowRunOutputSchema.nullable(), - context: workflowRunContextSchema.nullable(), state: workflowRunStateSchema.nullable(), status: workflowRunStatusSchema, createdAt: z.string(), diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowRunStepOutputDetail.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowRunStepOutputDetail.tsx index 2ca3c7451..cdc1704a2 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowRunStepOutputDetail.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowRunStepOutputDetail.tsx @@ -35,6 +35,8 @@ export const WorkflowRunStepOutputDetail = ({ stepId }: { stepId: string }) => { const stepInfo = workflowRun.state.stepInfos[stepId]; + const { status: _, ...stepInfoWithoutStatus } = stepInfo ?? {}; + const stepDefinition = getStepDefinitionOrThrow({ stepId, trigger: workflowRun.state.flow.trigger, @@ -84,7 +86,7 @@ export const WorkflowRunStepOutputDetail = ({ stepId }: { stepId: string }) => { { id: true, name: true, status: true, - output: true, - context: true, startedAt: true, endedAt: true, }, diff --git a/packages/twenty-front/src/testing/mock-data/workflow-run.ts b/packages/twenty-front/src/testing/mock-data/workflow-run.ts index 7fe590a39..12217b73f 100644 --- a/packages/twenty-front/src/testing/mock-data/workflow-run.ts +++ b/packages/twenty-front/src/testing/mock-data/workflow-run.ts @@ -6,4478 +6,11 @@ import { StepStatus } from 'twenty-shared/workflow'; export const oneSucceededWorkflowRunQueryResult = { workflowRun: { __typename: 'WorkflowRun', - context: { - trigger: { - userId: '20202020-9e3b-46d4-a556-88b9ddc2b034', - recordId: '6bba55b1-6be2-49d3-adcd-470a56547c73', - properties: { - after: { - id: '6bba55b1-6be2-49d3-adcd-470a56547c73', - name: '', - xLink: { - primaryLinkUrl: '', - secondaryLinks: [], - primaryLinkLabel: '', - }, - people: [], - address: { - addressLat: null, - addressLng: null, - addressCity: '', - addressState: '', - addressCountry: '', - addressStreet1: '', - addressStreet2: '', - addressPostcode: '', - }, - tagline: '', - position: -3, - createdAt: '2025-03-06T12:15:43.288Z', - createdBy: { - name: 'Tim Apple', - source: 'MANUAL', - context: {}, - workspaceMemberId: '20202020-0687-4c41-b707-ed1bfca972a7', - }, - deletedAt: null, - employees: null, - favorites: [], - updatedAt: '2025-03-06T12:15:43.288Z', - domainName: { - primaryLinkUrl: '', - secondaryLinks: [], - primaryLinkLabel: '', - }, - introVideo: { - primaryLinkUrl: '', - secondaryLinks: [], - primaryLinkLabel: '', - }, - workPolicy: null, - attachments: [], - noteTargets: [], - accountOwner: null, - linkedinLink: { - primaryLinkUrl: '', - secondaryLinks: [], - primaryLinkLabel: '', - }, - searchVector: '', - opportunities: [], - accountOwnerId: null, - visaSponsorship: false, - idealCustomerProfile: false, - annualRecurringRevenue: { - amountMicros: null, - currencyCode: '', - }, - }, - before: null, - }, - objectMetadata: { - id: '685ac06e-2351-421c-97ac-0bf4595819b8', - icon: 'IconBuildingSkyscraper', - fields: [ - { - id: '5fc216dc-7af4-4927-a026-0e5144afa436', - icon: 'IconBrandX', - name: 'xLink', - type: 'LINKS', - label: 'X', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-6f64-4fd9-9580-9c1991c7d8c3', - description: 'The company Twitter/X account', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'fba56220-3f40-4569-a500-35a4a312e473', - icon: 'IconMoneybag', - name: 'annualRecurringRevenue', - type: 'CURRENCY', - label: 'ARR', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-602a-495c-9776-f5d5b11d227b', - description: - 'Annual Recurring Revenue: The actual or estimated annual revenue of the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - amountMicros: null, - currencyCode: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '0b32256a-1bd2-40e1-98e0-74b400452aab', - icon: 'IconMap', - name: 'address', - type: 'ADDRESS', - label: 'Address', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-c5ce-4adc-b7b6-9c0979fc55e7', - description: 'Address of the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - addressLat: null, - addressLng: null, - addressCity: "''", - addressState: "''", - addressCountry: "''", - addressStreet1: "''", - addressStreet2: "''", - addressPostcode: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '214a5118-3ab5-4d2a-ac89-020f776831b3', - icon: 'IconTarget', - name: 'idealCustomerProfile', - type: 'BOOLEAN', - label: 'ICP', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-ba6b-438a-8213-2c5ba28d76a2', - description: - 'Ideal Customer Profile: Indicates whether the company is the most suitable and valuable customer for you', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: false, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'b66efff8-c0ef-4cb6-a5f1-3ea7fd0bfbb4', - icon: 'IconHierarchy2', - name: 'position', - type: 'POSITION', - label: 'Position', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-9b4e-462b-991d-a0ee33326454', - description: 'Company record position', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 0, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '943f218e-6061-4f61-ac3a-298ac14cef41', - icon: 'IconCreativeCommonsSa', - name: 'createdBy', - type: 'ACTOR', - label: 'Created by', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-fabc-451d-ab7d-412170916baa', - description: 'The creator of the record', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - name: "'System'", - source: "'MANUAL'", - context: {}, - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '8b1e9e2c-684f-4e9e-9bdf-e1f705f8ca03', - icon: 'IconUser', - name: 'searchVector', - type: 'TS_VECTOR', - label: 'Search vector', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '85c71601-72f9-4b7b-b343-d46100b2c74d', - description: 'Field used for full-text search', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '593dd556-69ab-4df7-aa2e-ab5e20eb7977', - icon: 'Icon123', - name: 'id', - type: 'UUID', - label: 'Id', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-eda0-4cee-9577-3eb357e3c22b', - description: 'Id', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 'uuid', - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '4ebb7bb9-d451-4433-880d-32cd3f3744df', - icon: 'IconCalendar', - name: 'createdAt', - type: 'DATE_TIME', - label: 'Creation date', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: { - displayFormat: 'RELATIVE', - }, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-66ac-4502-9975-e4d959c50311', - description: 'Creation date', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 'now', - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '39526b16-7d21-4a91-a70c-bca108b27989', - icon: 'IconCalendarClock', - name: 'updatedAt', - type: 'DATE_TIME', - label: 'Last update', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: { - displayFormat: 'RELATIVE', - }, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-d767-4622-bdcf-d8a084834d86', - description: 'Last time the record was changed', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 'now', - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '55e17b77-84f7-4b8a-bef5-be65f783d9f8', - icon: 'IconCalendarMinus', - name: 'deletedAt', - type: 'DATE_TIME', - label: 'Deleted at', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: { - displayFormat: 'RELATIVE', - }, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-b9a7-48d8-8387-b9a3090a50ec', - description: 'Date when the record was deleted', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '11a04849-150b-4af0-9332-b4a9ba693b17', - icon: 'IconUsers', - name: 'people', - type: 'RELATION', - label: 'People', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-3213-4ddf-9494-6422bcff8d7c', - description: 'People linked to the company.', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '427d1095-8ac0-4854-bf85-2adff18b653e', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'SET_NULL', - toFieldMetadataId: 'd25fcd48-4b3f-4d6a-b1c0-4241d64502ac', - toObjectMetadataId: '462ac013-3ba0-4e87-b6a3-07069c308ca3', - fromFieldMetadataId: '11a04849-150b-4af0-9332-b4a9ba693b17', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'a6f9558c-76df-49d1-9011-16f2f3b8dbe2', - icon: 'IconUserCircle', - name: 'accountOwnerId', - type: 'UUID', - label: 'Account Owner id (foreign key)', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-cce0-424e-8028-91f50eb9c768', - description: - 'Your team member responsible for managing the company account id foreign key', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '20e60c1f-2dd8-4f1f-a1eb-b4c179cbcd4a', - icon: 'IconUserCircle', - name: 'accountOwner', - type: 'RELATION', - label: 'Account Owner', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-95b8-4e10-9881-edb5d4765f9d', - description: - 'Your team member responsible for managing the company account', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: { - id: '9ca11143-4ae4-4ed4-b636-158bc14d9513', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'SET_NULL', - toFieldMetadataId: '20e60c1f-2dd8-4f1f-a1eb-b4c179cbcd4a', - toObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - fromFieldMetadataId: '58a6c41e-9ff0-4607-be3a-4356175b75dc', - fromObjectMetadataId: '82dd61be-d849-41c2-b7c2-6a8ddb796e3e', - }, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'c0d5849e-f4cd-4f40-81ff-5c8c82e49c07', - icon: 'IconCheckbox', - name: 'taskTargets', - type: 'RELATION', - label: 'Tasks', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-cb17-4a61-8f8f-3be6730480de', - description: 'Tasks tied to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '40a2f0d1-f420-46a2-a010-2489e7f27a9d', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: 'e3ee1c65-5ec0-4d68-aac4-6c66720240f0', - toObjectMetadataId: '3e31c837-b0f0-4e8e-a1e3-28d3b12950f4', - fromFieldMetadataId: 'c0d5849e-f4cd-4f40-81ff-5c8c82e49c07', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '7dd1b1ac-9765-423e-ac74-050b2b730885', - icon: 'IconNotes', - name: 'noteTargets', - type: 'RELATION', - label: 'Notes', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-bae0-4556-a74a-a9c686f77a88', - description: 'Notes tied to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: 'b240e206-e8ba-496a-9671-063ad48a447d', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: '5c582b90-c1d4-4ebe-bd66-3cc94e4abd35', - toObjectMetadataId: 'b58841d9-7545-41b7-bb84-75e821285933', - fromFieldMetadataId: '7dd1b1ac-9765-423e-ac74-050b2b730885', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '7524cc63-2522-4c70-8b12-21fe2fe8de26', - icon: 'IconTargetArrow', - name: 'opportunities', - type: 'RELATION', - label: 'Opportunities', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-add3-4658-8e23-d70dccb6d0ec', - description: 'Opportunities linked to the company.', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '889b83fc-9a5e-414c-acb6-48e5aa029394', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'SET_NULL', - toFieldMetadataId: '2a12de2d-3c43-4108-bd0a-f52b053e2449', - toObjectMetadataId: 'da77d279-8984-4cb1-987a-14e2b0501288', - fromFieldMetadataId: '7524cc63-2522-4c70-8b12-21fe2fe8de26', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '45b5decf-cd19-4a2e-a321-b0c7ad3c1407', - icon: 'IconHeart', - name: 'favorites', - type: 'RELATION', - label: 'Favorites', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-4d1d-41ac-b13b-621631298d55', - description: 'Favorites linked to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '2163bf40-3b55-4bf9-bb59-968b8eda9114', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: '3f34086f-ad66-4e1d-9d4b-f42cdc0f2040', - toObjectMetadataId: '323f077c-138b-4243-bbf2-59a77252f3c5', - fromFieldMetadataId: '45b5decf-cd19-4a2e-a321-b0c7ad3c1407', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '0ae7a621-f443-47f7-b255-82d2e589ca21', - icon: 'IconFileImport', - name: 'attachments', - type: 'RELATION', - label: 'Attachments', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-c1b5-4120-b0f0-987ca401ed53', - description: 'Attachments linked to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: 'a2c6a4d7-fbda-4075-9fec-0a96ee07953a', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: 'e907c0a6-3e66-45a4-9922-8bc4d5bf5208', - toObjectMetadataId: 'f85c3930-9919-4887-b950-2e0496597c58', - fromFieldMetadataId: '0ae7a621-f443-47f7-b255-82d2e589ca21', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '038ca1af-7f15-460d-b111-b71062a8a6be', - icon: 'IconIconTimelineEvent', - name: 'timelineActivities', - type: 'RELATION', - label: 'Timeline Activities', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-0414-4daf-9c0d-64fe7b27f89f', - description: 'Timeline Activities linked to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '29a10f41-0265-4775-923f-0bbf548dc2ec', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: '96896f47-cb02-4164-b3f2-c24d12b30e74', - toObjectMetadataId: '1a41f4ba-7aad-4111-8035-961962702ebb', - fromFieldMetadataId: '038ca1af-7f15-460d-b111-b71062a8a6be', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '4f069436-1c42-4ec4-8dda-6b22011fc75a', - icon: 'IconAdCircle', - name: 'tagline', - type: 'TEXT', - label: 'Tagline', - options: null, - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.009Z', - updatedAt: '2025-03-05T15:41:12.009Z', - isNullable: false, - standardId: null, - description: "Company's Tagline", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: "''", - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '49e40a03-3f21-49d5-b03a-439bbc9ab73b', - icon: 'IconVideo', - name: 'introVideo', - type: 'LINKS', - label: 'Intro Video', - options: null, - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.011Z', - updatedAt: '2025-03-05T15:41:12.011Z', - isNullable: true, - standardId: null, - description: "Company's Intro Video", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '8a2883df-3e19-4d52-9309-d636767d1b6a', - icon: 'IconHome', - name: 'workPolicy', - type: 'MULTI_SELECT', - label: 'Work Policy', - options: [ - { - id: '4554330a-c3db-4042-b941-c2e299734d12', - color: 'green', - label: 'On-Site', - value: 'ON_SITE', - position: 0, - }, - { - id: 'abfde6f9-64d5-430a-adb3-bea2f403d9a4', - color: 'turquoise', - label: 'Hybrid', - value: 'HYBRID', - position: 1, - }, - { - id: '8eaca902-05c5-4087-86c0-30c664c2c4f5', - color: 'sky', - label: 'Remote Work', - value: 'REMOTE_WORK', - position: 2, - }, - ], - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.013Z', - updatedAt: '2025-03-05T15:41:12.013Z', - isNullable: true, - standardId: null, - description: "Company's Work Policy", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '26a67635-7d43-47f0-b895-1c8194a7fa30', - icon: 'IconBrandVisa', - name: 'visaSponsorship', - type: 'BOOLEAN', - label: 'Visa Sponsorship', - options: null, - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.014Z', - updatedAt: '2025-03-05T15:41:12.014Z', - isNullable: true, - standardId: null, - description: "Company's Visa Sponsorship Policy", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: false, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'c6e6cf7d-63af-4131-9f99-ce0f74fd7d10', - icon: 'IconBuildingSkyscraper', - name: 'name', - type: 'TEXT', - label: 'Name', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-4d99-4e2e-a84c-4a27837b1ece', - description: 'The company name', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: "''", - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'dbc86e47-d2cf-4094-9a57-90212efde6a0', - icon: 'IconLink', - name: 'domainName', - type: 'LINKS', - label: 'Domain Name', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: true, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-0c28-43d8-8ba5-3659924d3489', - description: - 'The company website URL. We use this url to fetch the company icon', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'c750e2c6-3de6-4c18-9876-6ba5ba970d42', - icon: 'IconUsers', - name: 'employees', - type: 'NUMBER', - label: 'Employees', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-8965-464a-8a75-74bafc152a0b', - description: 'Number of employees in the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'a4230bd8-66ec-4f2f-810b-1d02f9709bfa', - icon: 'IconBrandLinkedin', - name: 'linkedinLink', - type: 'LINKS', - label: 'Linkedin', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-ebeb-4beb-b9ad-6848036fb451', - description: 'The company Linkedin account', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - ], - isActive: true, - isCustom: false, - isRemote: false, - isSystem: false, - shortcut: 'C', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - fieldsById: { - '038ca1af-7f15-460d-b111-b71062a8a6be': { - id: '038ca1af-7f15-460d-b111-b71062a8a6be', - icon: 'IconIconTimelineEvent', - name: 'timelineActivities', - type: 'RELATION', - label: 'Timeline Activities', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-0414-4daf-9c0d-64fe7b27f89f', - description: 'Timeline Activities linked to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '29a10f41-0265-4775-923f-0bbf548dc2ec', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: '96896f47-cb02-4164-b3f2-c24d12b30e74', - toObjectMetadataId: '1a41f4ba-7aad-4111-8035-961962702ebb', - fromFieldMetadataId: '038ca1af-7f15-460d-b111-b71062a8a6be', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '0ae7a621-f443-47f7-b255-82d2e589ca21': { - id: '0ae7a621-f443-47f7-b255-82d2e589ca21', - icon: 'IconFileImport', - name: 'attachments', - type: 'RELATION', - label: 'Attachments', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-c1b5-4120-b0f0-987ca401ed53', - description: 'Attachments linked to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: 'a2c6a4d7-fbda-4075-9fec-0a96ee07953a', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: 'e907c0a6-3e66-45a4-9922-8bc4d5bf5208', - toObjectMetadataId: 'f85c3930-9919-4887-b950-2e0496597c58', - fromFieldMetadataId: '0ae7a621-f443-47f7-b255-82d2e589ca21', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '0b32256a-1bd2-40e1-98e0-74b400452aab': { - id: '0b32256a-1bd2-40e1-98e0-74b400452aab', - icon: 'IconMap', - name: 'address', - type: 'ADDRESS', - label: 'Address', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-c5ce-4adc-b7b6-9c0979fc55e7', - description: 'Address of the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - addressLat: null, - addressLng: null, - addressCity: "''", - addressState: "''", - addressCountry: "''", - addressStreet1: "''", - addressStreet2: "''", - addressPostcode: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '11a04849-150b-4af0-9332-b4a9ba693b17': { - id: '11a04849-150b-4af0-9332-b4a9ba693b17', - icon: 'IconUsers', - name: 'people', - type: 'RELATION', - label: 'People', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-3213-4ddf-9494-6422bcff8d7c', - description: 'People linked to the company.', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '427d1095-8ac0-4854-bf85-2adff18b653e', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'SET_NULL', - toFieldMetadataId: 'd25fcd48-4b3f-4d6a-b1c0-4241d64502ac', - toObjectMetadataId: '462ac013-3ba0-4e87-b6a3-07069c308ca3', - fromFieldMetadataId: '11a04849-150b-4af0-9332-b4a9ba693b17', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '20e60c1f-2dd8-4f1f-a1eb-b4c179cbcd4a': { - id: '20e60c1f-2dd8-4f1f-a1eb-b4c179cbcd4a', - icon: 'IconUserCircle', - name: 'accountOwner', - type: 'RELATION', - label: 'Account Owner', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-95b8-4e10-9881-edb5d4765f9d', - description: - 'Your team member responsible for managing the company account', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: { - id: '9ca11143-4ae4-4ed4-b636-158bc14d9513', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'SET_NULL', - toFieldMetadataId: '20e60c1f-2dd8-4f1f-a1eb-b4c179cbcd4a', - toObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - fromFieldMetadataId: '58a6c41e-9ff0-4607-be3a-4356175b75dc', - fromObjectMetadataId: '82dd61be-d849-41c2-b7c2-6a8ddb796e3e', - }, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '214a5118-3ab5-4d2a-ac89-020f776831b3': { - id: '214a5118-3ab5-4d2a-ac89-020f776831b3', - icon: 'IconTarget', - name: 'idealCustomerProfile', - type: 'BOOLEAN', - label: 'ICP', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-ba6b-438a-8213-2c5ba28d76a2', - description: - 'Ideal Customer Profile: Indicates whether the company is the most suitable and valuable customer for you', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: false, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '26a67635-7d43-47f0-b895-1c8194a7fa30': { - id: '26a67635-7d43-47f0-b895-1c8194a7fa30', - icon: 'IconBrandVisa', - name: 'visaSponsorship', - type: 'BOOLEAN', - label: 'Visa Sponsorship', - options: null, - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.014Z', - updatedAt: '2025-03-05T15:41:12.014Z', - isNullable: true, - standardId: null, - description: "Company's Visa Sponsorship Policy", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: false, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '39526b16-7d21-4a91-a70c-bca108b27989': { - id: '39526b16-7d21-4a91-a70c-bca108b27989', - icon: 'IconCalendarClock', - name: 'updatedAt', - type: 'DATE_TIME', - label: 'Last update', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: { - displayFormat: 'RELATIVE', - }, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-d767-4622-bdcf-d8a084834d86', - description: 'Last time the record was changed', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 'now', - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '45b5decf-cd19-4a2e-a321-b0c7ad3c1407': { - id: '45b5decf-cd19-4a2e-a321-b0c7ad3c1407', - icon: 'IconHeart', - name: 'favorites', - type: 'RELATION', - label: 'Favorites', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-4d1d-41ac-b13b-621631298d55', - description: 'Favorites linked to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '2163bf40-3b55-4bf9-bb59-968b8eda9114', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: '3f34086f-ad66-4e1d-9d4b-f42cdc0f2040', - toObjectMetadataId: '323f077c-138b-4243-bbf2-59a77252f3c5', - fromFieldMetadataId: '45b5decf-cd19-4a2e-a321-b0c7ad3c1407', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '49e40a03-3f21-49d5-b03a-439bbc9ab73b': { - id: '49e40a03-3f21-49d5-b03a-439bbc9ab73b', - icon: 'IconVideo', - name: 'introVideo', - type: 'LINKS', - label: 'Intro Video', - options: null, - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.011Z', - updatedAt: '2025-03-05T15:41:12.011Z', - isNullable: true, - standardId: null, - description: "Company's Intro Video", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '4ebb7bb9-d451-4433-880d-32cd3f3744df': { - id: '4ebb7bb9-d451-4433-880d-32cd3f3744df', - icon: 'IconCalendar', - name: 'createdAt', - type: 'DATE_TIME', - label: 'Creation date', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: { - displayFormat: 'RELATIVE', - }, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-66ac-4502-9975-e4d959c50311', - description: 'Creation date', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 'now', - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '4f069436-1c42-4ec4-8dda-6b22011fc75a': { - id: '4f069436-1c42-4ec4-8dda-6b22011fc75a', - icon: 'IconAdCircle', - name: 'tagline', - type: 'TEXT', - label: 'Tagline', - options: null, - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.009Z', - updatedAt: '2025-03-05T15:41:12.009Z', - isNullable: false, - standardId: null, - description: "Company's Tagline", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: "''", - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '55e17b77-84f7-4b8a-bef5-be65f783d9f8': { - id: '55e17b77-84f7-4b8a-bef5-be65f783d9f8', - icon: 'IconCalendarMinus', - name: 'deletedAt', - type: 'DATE_TIME', - label: 'Deleted at', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: { - displayFormat: 'RELATIVE', - }, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-b9a7-48d8-8387-b9a3090a50ec', - description: 'Date when the record was deleted', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '593dd556-69ab-4df7-aa2e-ab5e20eb7977': { - id: '593dd556-69ab-4df7-aa2e-ab5e20eb7977', - icon: 'Icon123', - name: 'id', - type: 'UUID', - label: 'Id', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-eda0-4cee-9577-3eb357e3c22b', - description: 'Id', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 'uuid', - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '5fc216dc-7af4-4927-a026-0e5144afa436': { - id: '5fc216dc-7af4-4927-a026-0e5144afa436', - icon: 'IconBrandX', - name: 'xLink', - type: 'LINKS', - label: 'X', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-6f64-4fd9-9580-9c1991c7d8c3', - description: 'The company Twitter/X account', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '7524cc63-2522-4c70-8b12-21fe2fe8de26': { - id: '7524cc63-2522-4c70-8b12-21fe2fe8de26', - icon: 'IconTargetArrow', - name: 'opportunities', - type: 'RELATION', - label: 'Opportunities', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-add3-4658-8e23-d70dccb6d0ec', - description: 'Opportunities linked to the company.', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '889b83fc-9a5e-414c-acb6-48e5aa029394', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'SET_NULL', - toFieldMetadataId: '2a12de2d-3c43-4108-bd0a-f52b053e2449', - toObjectMetadataId: 'da77d279-8984-4cb1-987a-14e2b0501288', - fromFieldMetadataId: '7524cc63-2522-4c70-8b12-21fe2fe8de26', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '7dd1b1ac-9765-423e-ac74-050b2b730885': { - id: '7dd1b1ac-9765-423e-ac74-050b2b730885', - icon: 'IconNotes', - name: 'noteTargets', - type: 'RELATION', - label: 'Notes', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-bae0-4556-a74a-a9c686f77a88', - description: 'Notes tied to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: 'b240e206-e8ba-496a-9671-063ad48a447d', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: '5c582b90-c1d4-4ebe-bd66-3cc94e4abd35', - toObjectMetadataId: 'b58841d9-7545-41b7-bb84-75e821285933', - fromFieldMetadataId: '7dd1b1ac-9765-423e-ac74-050b2b730885', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '8a2883df-3e19-4d52-9309-d636767d1b6a': { - id: '8a2883df-3e19-4d52-9309-d636767d1b6a', - icon: 'IconHome', - name: 'workPolicy', - type: 'MULTI_SELECT', - label: 'Work Policy', - options: [ - { - id: '4554330a-c3db-4042-b941-c2e299734d12', - color: 'green', - label: 'On-Site', - value: 'ON_SITE', - position: 0, - }, - { - id: 'abfde6f9-64d5-430a-adb3-bea2f403d9a4', - color: 'turquoise', - label: 'Hybrid', - value: 'HYBRID', - position: 1, - }, - { - id: '8eaca902-05c5-4087-86c0-30c664c2c4f5', - color: 'sky', - label: 'Remote Work', - value: 'REMOTE_WORK', - position: 2, - }, - ], - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.013Z', - updatedAt: '2025-03-05T15:41:12.013Z', - isNullable: true, - standardId: null, - description: "Company's Work Policy", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '8b1e9e2c-684f-4e9e-9bdf-e1f705f8ca03': { - id: '8b1e9e2c-684f-4e9e-9bdf-e1f705f8ca03', - icon: 'IconUser', - name: 'searchVector', - type: 'TS_VECTOR', - label: 'Search vector', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '85c71601-72f9-4b7b-b343-d46100b2c74d', - description: 'Field used for full-text search', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - '943f218e-6061-4f61-ac3a-298ac14cef41': { - id: '943f218e-6061-4f61-ac3a-298ac14cef41', - icon: 'IconCreativeCommonsSa', - name: 'createdBy', - type: 'ACTOR', - label: 'Created by', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-fabc-451d-ab7d-412170916baa', - description: 'The creator of the record', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - name: "'System'", - source: "'MANUAL'", - context: {}, - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - 'a4230bd8-66ec-4f2f-810b-1d02f9709bfa': { - id: 'a4230bd8-66ec-4f2f-810b-1d02f9709bfa', - icon: 'IconBrandLinkedin', - name: 'linkedinLink', - type: 'LINKS', - label: 'Linkedin', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-ebeb-4beb-b9ad-6848036fb451', - description: 'The company Linkedin account', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - 'a6f9558c-76df-49d1-9011-16f2f3b8dbe2': { - id: 'a6f9558c-76df-49d1-9011-16f2f3b8dbe2', - icon: 'IconUserCircle', - name: 'accountOwnerId', - type: 'UUID', - label: 'Account Owner id (foreign key)', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-cce0-424e-8028-91f50eb9c768', - description: - 'Your team member responsible for managing the company account id foreign key', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - 'b66efff8-c0ef-4cb6-a5f1-3ea7fd0bfbb4': { - id: 'b66efff8-c0ef-4cb6-a5f1-3ea7fd0bfbb4', - icon: 'IconHierarchy2', - name: 'position', - type: 'POSITION', - label: 'Position', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-9b4e-462b-991d-a0ee33326454', - description: 'Company record position', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 0, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - 'c0d5849e-f4cd-4f40-81ff-5c8c82e49c07': { - id: 'c0d5849e-f4cd-4f40-81ff-5c8c82e49c07', - icon: 'IconCheckbox', - name: 'taskTargets', - type: 'RELATION', - label: 'Tasks', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-cb17-4a61-8f8f-3be6730480de', - description: 'Tasks tied to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '40a2f0d1-f420-46a2-a010-2489e7f27a9d', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: 'e3ee1c65-5ec0-4d68-aac4-6c66720240f0', - toObjectMetadataId: '3e31c837-b0f0-4e8e-a1e3-28d3b12950f4', - fromFieldMetadataId: 'c0d5849e-f4cd-4f40-81ff-5c8c82e49c07', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - 'c6e6cf7d-63af-4131-9f99-ce0f74fd7d10': { - id: 'c6e6cf7d-63af-4131-9f99-ce0f74fd7d10', - icon: 'IconBuildingSkyscraper', - name: 'name', - type: 'TEXT', - label: 'Name', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-4d99-4e2e-a84c-4a27837b1ece', - description: 'The company name', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: "''", - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - 'c750e2c6-3de6-4c18-9876-6ba5ba970d42': { - id: 'c750e2c6-3de6-4c18-9876-6ba5ba970d42', - icon: 'IconUsers', - name: 'employees', - type: 'NUMBER', - label: 'Employees', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-8965-464a-8a75-74bafc152a0b', - description: 'Number of employees in the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - 'dbc86e47-d2cf-4094-9a57-90212efde6a0': { - id: 'dbc86e47-d2cf-4094-9a57-90212efde6a0', - icon: 'IconLink', - name: 'domainName', - type: 'LINKS', - label: 'Domain Name', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: true, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-0c28-43d8-8ba5-3659924d3489', - description: - 'The company website URL. We use this url to fetch the company icon', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - 'fba56220-3f40-4569-a500-35a4a312e473': { - id: 'fba56220-3f40-4569-a500-35a4a312e473', - icon: 'IconMoneybag', - name: 'annualRecurringRevenue', - type: 'CURRENCY', - label: 'ARR', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-602a-495c-9776-f5d5b11d227b', - description: - 'Annual Recurring Revenue: The actual or estimated annual revenue of the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - amountMicros: null, - currencyCode: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - }, - namePlural: 'companies', - standardId: '20202020-b374-4779-a561-80086cb2e17f', - description: 'A company', - labelPlural: 'Companies', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - dataSourceId: 'f20df2e6-420e-40e0-a4ca-68846bbe6c92', - fieldsByName: { - id: { - id: '593dd556-69ab-4df7-aa2e-ab5e20eb7977', - icon: 'Icon123', - name: 'id', - type: 'UUID', - label: 'Id', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-eda0-4cee-9577-3eb357e3c22b', - description: 'Id', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 'uuid', - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - name: { - id: 'c6e6cf7d-63af-4131-9f99-ce0f74fd7d10', - icon: 'IconBuildingSkyscraper', - name: 'name', - type: 'TEXT', - label: 'Name', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-4d99-4e2e-a84c-4a27837b1ece', - description: 'The company name', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: "''", - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - xLink: { - id: '5fc216dc-7af4-4927-a026-0e5144afa436', - icon: 'IconBrandX', - name: 'xLink', - type: 'LINKS', - label: 'X', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-6f64-4fd9-9580-9c1991c7d8c3', - description: 'The company Twitter/X account', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - people: { - id: '11a04849-150b-4af0-9332-b4a9ba693b17', - icon: 'IconUsers', - name: 'people', - type: 'RELATION', - label: 'People', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-3213-4ddf-9494-6422bcff8d7c', - description: 'People linked to the company.', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '427d1095-8ac0-4854-bf85-2adff18b653e', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'SET_NULL', - toFieldMetadataId: 'd25fcd48-4b3f-4d6a-b1c0-4241d64502ac', - toObjectMetadataId: '462ac013-3ba0-4e87-b6a3-07069c308ca3', - fromFieldMetadataId: '11a04849-150b-4af0-9332-b4a9ba693b17', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - address: { - id: '0b32256a-1bd2-40e1-98e0-74b400452aab', - icon: 'IconMap', - name: 'address', - type: 'ADDRESS', - label: 'Address', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-c5ce-4adc-b7b6-9c0979fc55e7', - description: 'Address of the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - addressLat: null, - addressLng: null, - addressCity: "''", - addressState: "''", - addressCountry: "''", - addressStreet1: "''", - addressStreet2: "''", - addressPostcode: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - tagline: { - id: '4f069436-1c42-4ec4-8dda-6b22011fc75a', - icon: 'IconAdCircle', - name: 'tagline', - type: 'TEXT', - label: 'Tagline', - options: null, - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.009Z', - updatedAt: '2025-03-05T15:41:12.009Z', - isNullable: false, - standardId: null, - description: "Company's Tagline", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: "''", - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - position: { - id: 'b66efff8-c0ef-4cb6-a5f1-3ea7fd0bfbb4', - icon: 'IconHierarchy2', - name: 'position', - type: 'POSITION', - label: 'Position', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-9b4e-462b-991d-a0ee33326454', - description: 'Company record position', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 0, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - createdAt: { - id: '4ebb7bb9-d451-4433-880d-32cd3f3744df', - icon: 'IconCalendar', - name: 'createdAt', - type: 'DATE_TIME', - label: 'Creation date', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: { - displayFormat: 'RELATIVE', - }, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-66ac-4502-9975-e4d959c50311', - description: 'Creation date', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 'now', - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - createdBy: { - id: '943f218e-6061-4f61-ac3a-298ac14cef41', - icon: 'IconCreativeCommonsSa', - name: 'createdBy', - type: 'ACTOR', - label: 'Created by', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-fabc-451d-ab7d-412170916baa', - description: 'The creator of the record', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - name: "'System'", - source: "'MANUAL'", - context: {}, - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - deletedAt: { - id: '55e17b77-84f7-4b8a-bef5-be65f783d9f8', - icon: 'IconCalendarMinus', - name: 'deletedAt', - type: 'DATE_TIME', - label: 'Deleted at', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: { - displayFormat: 'RELATIVE', - }, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-b9a7-48d8-8387-b9a3090a50ec', - description: 'Date when the record was deleted', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - employees: { - id: 'c750e2c6-3de6-4c18-9876-6ba5ba970d42', - icon: 'IconUsers', - name: 'employees', - type: 'NUMBER', - label: 'Employees', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-8965-464a-8a75-74bafc152a0b', - description: 'Number of employees in the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - favorites: { - id: '45b5decf-cd19-4a2e-a321-b0c7ad3c1407', - icon: 'IconHeart', - name: 'favorites', - type: 'RELATION', - label: 'Favorites', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-4d1d-41ac-b13b-621631298d55', - description: 'Favorites linked to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '2163bf40-3b55-4bf9-bb59-968b8eda9114', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: '3f34086f-ad66-4e1d-9d4b-f42cdc0f2040', - toObjectMetadataId: '323f077c-138b-4243-bbf2-59a77252f3c5', - fromFieldMetadataId: '45b5decf-cd19-4a2e-a321-b0c7ad3c1407', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - updatedAt: { - id: '39526b16-7d21-4a91-a70c-bca108b27989', - icon: 'IconCalendarClock', - name: 'updatedAt', - type: 'DATE_TIME', - label: 'Last update', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: { - displayFormat: 'RELATIVE', - }, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-d767-4622-bdcf-d8a084834d86', - description: 'Last time the record was changed', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 'now', - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - domainName: { - id: 'dbc86e47-d2cf-4094-9a57-90212efde6a0', - icon: 'IconLink', - name: 'domainName', - type: 'LINKS', - label: 'Domain Name', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: true, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-0c28-43d8-8ba5-3659924d3489', - description: - 'The company website URL. We use this url to fetch the company icon', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - introVideo: { - id: '49e40a03-3f21-49d5-b03a-439bbc9ab73b', - icon: 'IconVideo', - name: 'introVideo', - type: 'LINKS', - label: 'Intro Video', - options: null, - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.011Z', - updatedAt: '2025-03-05T15:41:12.011Z', - isNullable: true, - standardId: null, - description: "Company's Intro Video", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - workPolicy: { - id: '8a2883df-3e19-4d52-9309-d636767d1b6a', - icon: 'IconHome', - name: 'workPolicy', - type: 'MULTI_SELECT', - label: 'Work Policy', - options: [ - { - id: '4554330a-c3db-4042-b941-c2e299734d12', - color: 'green', - label: 'On-Site', - value: 'ON_SITE', - position: 0, - }, - { - id: 'abfde6f9-64d5-430a-adb3-bea2f403d9a4', - color: 'turquoise', - label: 'Hybrid', - value: 'HYBRID', - position: 1, - }, - { - id: '8eaca902-05c5-4087-86c0-30c664c2c4f5', - color: 'sky', - label: 'Remote Work', - value: 'REMOTE_WORK', - position: 2, - }, - ], - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.013Z', - updatedAt: '2025-03-05T15:41:12.013Z', - isNullable: true, - standardId: null, - description: "Company's Work Policy", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - attachments: { - id: '0ae7a621-f443-47f7-b255-82d2e589ca21', - icon: 'IconFileImport', - name: 'attachments', - type: 'RELATION', - label: 'Attachments', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-c1b5-4120-b0f0-987ca401ed53', - description: 'Attachments linked to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: 'a2c6a4d7-fbda-4075-9fec-0a96ee07953a', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: 'e907c0a6-3e66-45a4-9922-8bc4d5bf5208', - toObjectMetadataId: 'f85c3930-9919-4887-b950-2e0496597c58', - fromFieldMetadataId: '0ae7a621-f443-47f7-b255-82d2e589ca21', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - noteTargets: { - id: '7dd1b1ac-9765-423e-ac74-050b2b730885', - icon: 'IconNotes', - name: 'noteTargets', - type: 'RELATION', - label: 'Notes', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-bae0-4556-a74a-a9c686f77a88', - description: 'Notes tied to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: 'b240e206-e8ba-496a-9671-063ad48a447d', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: '5c582b90-c1d4-4ebe-bd66-3cc94e4abd35', - toObjectMetadataId: 'b58841d9-7545-41b7-bb84-75e821285933', - fromFieldMetadataId: '7dd1b1ac-9765-423e-ac74-050b2b730885', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - taskTargets: { - id: 'c0d5849e-f4cd-4f40-81ff-5c8c82e49c07', - icon: 'IconCheckbox', - name: 'taskTargets', - type: 'RELATION', - label: 'Tasks', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-cb17-4a61-8f8f-3be6730480de', - description: 'Tasks tied to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '40a2f0d1-f420-46a2-a010-2489e7f27a9d', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: 'e3ee1c65-5ec0-4d68-aac4-6c66720240f0', - toObjectMetadataId: '3e31c837-b0f0-4e8e-a1e3-28d3b12950f4', - fromFieldMetadataId: 'c0d5849e-f4cd-4f40-81ff-5c8c82e49c07', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - accountOwner: { - id: '20e60c1f-2dd8-4f1f-a1eb-b4c179cbcd4a', - icon: 'IconUserCircle', - name: 'accountOwner', - type: 'RELATION', - label: 'Account Owner', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-95b8-4e10-9881-edb5d4765f9d', - description: - 'Your team member responsible for managing the company account', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: { - id: '9ca11143-4ae4-4ed4-b636-158bc14d9513', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'SET_NULL', - toFieldMetadataId: '20e60c1f-2dd8-4f1f-a1eb-b4c179cbcd4a', - toObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - fromFieldMetadataId: '58a6c41e-9ff0-4607-be3a-4356175b75dc', - fromObjectMetadataId: '82dd61be-d849-41c2-b7c2-6a8ddb796e3e', - }, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - linkedinLink: { - id: 'a4230bd8-66ec-4f2f-810b-1d02f9709bfa', - icon: 'IconBrandLinkedin', - name: 'linkedinLink', - type: 'LINKS', - label: 'Linkedin', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-ebeb-4beb-b9ad-6848036fb451', - description: 'The company Linkedin account', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - searchVector: { - id: '8b1e9e2c-684f-4e9e-9bdf-e1f705f8ca03', - icon: 'IconUser', - name: 'searchVector', - type: 'TS_VECTOR', - label: 'Search vector', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '85c71601-72f9-4b7b-b343-d46100b2c74d', - description: 'Field used for full-text search', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - opportunities: { - id: '7524cc63-2522-4c70-8b12-21fe2fe8de26', - icon: 'IconTargetArrow', - name: 'opportunities', - type: 'RELATION', - label: 'Opportunities', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-add3-4658-8e23-d70dccb6d0ec', - description: 'Opportunities linked to the company.', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '889b83fc-9a5e-414c-acb6-48e5aa029394', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'SET_NULL', - toFieldMetadataId: '2a12de2d-3c43-4108-bd0a-f52b053e2449', - toObjectMetadataId: 'da77d279-8984-4cb1-987a-14e2b0501288', - fromFieldMetadataId: '7524cc63-2522-4c70-8b12-21fe2fe8de26', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - accountOwnerId: { - id: 'a6f9558c-76df-49d1-9011-16f2f3b8dbe2', - icon: 'IconUserCircle', - name: 'accountOwnerId', - type: 'UUID', - label: 'Account Owner id (foreign key)', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-cce0-424e-8028-91f50eb9c768', - description: - 'Your team member responsible for managing the company account id foreign key', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - visaSponsorship: { - id: '26a67635-7d43-47f0-b895-1c8194a7fa30', - icon: 'IconBrandVisa', - name: 'visaSponsorship', - type: 'BOOLEAN', - label: 'Visa Sponsorship', - options: null, - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.014Z', - updatedAt: '2025-03-05T15:41:12.014Z', - isNullable: true, - standardId: null, - description: "Company's Visa Sponsorship Policy", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: false, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - timelineActivities: { - id: '038ca1af-7f15-460d-b111-b71062a8a6be', - icon: 'IconIconTimelineEvent', - name: 'timelineActivities', - type: 'RELATION', - label: 'Timeline Activities', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-0414-4daf-9c0d-64fe7b27f89f', - description: 'Timeline Activities linked to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: { - id: '29a10f41-0265-4775-923f-0bbf548dc2ec', - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - relationType: 'ONE_TO_MANY', - onDeleteAction: 'CASCADE', - toFieldMetadataId: '96896f47-cb02-4164-b3f2-c24d12b30e74', - toObjectMetadataId: '1a41f4ba-7aad-4111-8035-961962702ebb', - fromFieldMetadataId: '038ca1af-7f15-460d-b111-b71062a8a6be', - fromObjectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - }, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - idealCustomerProfile: { - id: '214a5118-3ab5-4d2a-ac89-020f776831b3', - icon: 'IconTarget', - name: 'idealCustomerProfile', - type: 'BOOLEAN', - label: 'ICP', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-ba6b-438a-8213-2c5ba28d76a2', - description: - 'Ideal Customer Profile: Indicates whether the company is the most suitable and valuable customer for you', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: false, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - annualRecurringRevenue: { - id: 'fba56220-3f40-4569-a500-35a4a312e473', - icon: 'IconMoneybag', - name: 'annualRecurringRevenue', - type: 'CURRENCY', - label: 'ARR', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-602a-495c-9776-f5d5b11d227b', - description: - 'Annual Recurring Revenue: The actual or estimated annual revenue of the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - amountMicros: null, - currencyCode: "''", - }, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - toRelationMetadata: null, - fromRelationMetadata: null, - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - }, - isSearchable: true, - nameSingular: 'company', - isAuditLogged: true, - labelSingular: 'Company', - indexMetadatas: [ - { - id: '9d5ef0cf-a301-44bf-98dd-c839d363f8f6', - name: 'IDX_UNIQUE_2a32339058d0b6910b0834ddf81', - isCustom: false, - isUnique: true, - createdAt: '2025-03-05T15:41:09.390Z', - indexType: 'BTREE', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - indexWhereClause: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - indexFieldMetadatas: [ - { - id: '12f75acc-33fc-49ee-af8f-39d9e8f17c3d', - order: 0, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - fieldMetadataId: 'dbc86e47-d2cf-4094-9a57-90212efde6a0', - indexMetadataId: '9d5ef0cf-a301-44bf-98dd-c839d363f8f6', - }, - ], - }, - { - id: 'e554c7bb-c355-4594-a708-4ea4e7cbcbdc', - name: 'IDX_123501237187c835ede626367b7', - isCustom: false, - isUnique: false, - createdAt: '2025-03-05T15:41:09.390Z', - indexType: 'BTREE', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - indexWhereClause: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - indexFieldMetadatas: [ - { - id: 'cf3ebe8e-e213-4c4c-939f-d7fb36016823', - order: 0, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - fieldMetadataId: 'a6f9558c-76df-49d1-9011-16f2f3b8dbe2', - indexMetadataId: 'e554c7bb-c355-4594-a708-4ea4e7cbcbdc', - }, - { - id: 'd2663353-c4a2-4787-98d1-6ad448a66d86', - order: 1, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - fieldMetadataId: '55e17b77-84f7-4b8a-bef5-be65f783d9f8', - indexMetadataId: 'e554c7bb-c355-4594-a708-4ea4e7cbcbdc', - }, - ], - }, - { - id: '48102f0b-0aef-4ae3-b3de-54e7c5bbdd1c', - name: 'IDX_fb1f4905546cfc6d70a971c76f7', - isCustom: false, - isUnique: false, - createdAt: '2025-03-05T15:41:09.390Z', - indexType: 'GIN', - updatedAt: '2025-03-05T15:41:09.390Z', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - indexWhereClause: null, - objectMetadataId: '685ac06e-2351-421c-97ac-0bf4595819b8', - indexFieldMetadatas: [ - { - id: '5cd649b1-79b8-4b07-9c56-b70fe247954b', - order: 0, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - fieldMetadataId: '8b1e9e2c-684f-4e9e-9bdf-e1f705f8ca03', - indexMetadataId: '48102f0b-0aef-4ae3-b3de-54e7c5bbdd1c', - }, - ], - }, - ], - targetTableName: 'DEPRECATED', - duplicateCriteria: [['name'], ['domainNamePrimaryLinkUrl']], - isLabelSyncedWithName: false, - imageIdentifierFieldMetadataId: null, - labelIdentifierFieldMetadataId: - 'c6e6cf7d-63af-4131-9f99-ce0f74fd7d10', - }, - }, - '212a171a-f887-4213-8892-e39c2a3ecc30': { - userId: ['20202020', '9e3b', '46d4', 'a556', '88b9ddc2b034'], - }, - '753b124e-f427-44a4-ab08-bacfe9c2f746': { - id: '0455ca41-bae1-4a3a-968c-b268a4e809bb', - title: 'Proposal for ', - bodyV2: { - markdown: '', - blocknote: '', - }, - position: 0, - createdAt: '2025-03-06T12:15:43.371Z', - createdBy: { - name: 'Workflow', - source: 'WORKFLOW', - context: {}, - workspaceMemberId: null, - }, - deletedAt: null, - updatedAt: '2025-03-06T12:15:43.371Z', - searchVector: "'for':2 'proposal':1", - }, - 'a01b2953-9aa7-4d9a-aded-8e9bafbd6c30': { - date: '2025-03-06T12:15:43.358Z', - }, - 'd4a73172-3156-45bf-bc49-9358fbab2907': { - id: 'f76b6058-2c8b-4bfa-86c1-4a4d39de3ee9', - name: 'Opportunity with ', - stage: 'NEW', - amount: { - amountMicros: null, - currencyCode: '', - }, - position: 0, - closeDate: null, - companyId: null, - createdAt: '2025-03-06T12:15:43.386Z', - createdBy: { - name: 'Workflow', - source: 'WORKFLOW', - context: {}, - workspaceMemberId: null, - }, - deletedAt: null, - updatedAt: '2025-03-06T12:15:43.386Z', - searchVector: "'opportunity':1 'with':2", - pointOfContactId: null, - }, - }, createdAt: '2025-03-06T12:15:43.316Z', deletedAt: null, endedAt: '2025-03-06T12:15:43.404Z', id: 'cb13fb82-82e5-46b6-8a80-0f8251ac98ff', name: 'Execution of v5', - output: { - flow: { - steps: [ - { - id: '212a171a-f887-4213-8892-e39c2a3ecc30', - name: 'Code - Serverless Function', - type: 'CODE', - valid: false, - settings: { - input: { - serverlessFunctionId: 'e031ae6a-5b9e-496b-9a98-ba015f7b5508', - serverlessFunctionInput: { - userId: '{{trigger.userId}}', - }, - serverlessFunctionVersion: '1', - }, - outputSchema: { - link: { - tab: 'test', - icon: 'IconVariable', - label: 'Generate Function Output', - isLeaf: true, - }, - _outputSchemaType: 'LINK', - }, - errorHandlingOptions: { - retryOnFailure: { - value: false, - }, - continueOnFailure: { - value: false, - }, - }, - }, - }, - { - id: 'a01b2953-9aa7-4d9a-aded-8e9bafbd6c30', - name: 'Code - Serverless Function', - type: 'CODE', - valid: false, - settings: { - input: { - serverlessFunctionId: '605efcda-6689-43b3-b24c-2eb76948f523', - serverlessFunctionInput: {}, - serverlessFunctionVersion: '2', - }, - outputSchema: { - link: { - tab: 'test', - icon: 'IconVariable', - label: 'Generate Function Output', - isLeaf: true, - }, - _outputSchemaType: 'LINK', - }, - errorHandlingOptions: { - retryOnFailure: { - value: false, - }, - continueOnFailure: { - value: false, - }, - }, - }, - }, - { - id: '753b124e-f427-44a4-ab08-bacfe9c2f746', - name: 'Create Record', - type: 'CREATE_RECORD', - valid: false, - settings: { - input: { - objectName: 'note', - objectRecord: { - title: 'Proposal for {{trigger.properties.after.name}}', - }, - }, - outputSchema: { - fields: { - id: { - icon: 'Icon123', - type: 'UUID', - label: 'Id', - value: '123e4567-e89b-12d3-a456-426614174000', - isLeaf: true, - }, - title: { - icon: 'IconNotes', - type: 'TEXT', - label: 'Title', - value: 'My text', - isLeaf: true, - }, - bodyV2: { - icon: 'IconFilePencil', - label: 'Body', - value: { - markdown: { - type: 'TEXT', - label: ' Markdown', - value: 'My text', - isLeaf: true, - }, - blocknote: { - type: 'TEXT', - label: ' Blocknote', - value: 'My text', - isLeaf: true, - }, - }, - isLeaf: false, - }, - createdAt: { - icon: 'IconCalendar', - type: 'DATE_TIME', - label: 'Creation date', - value: '01/23/2025 15:16', - isLeaf: true, - }, - createdBy: { - icon: 'IconCreativeCommonsSa', - label: 'Created by', - value: { - name: { - type: 'TEXT', - label: ' Name', - value: 'My text', - isLeaf: true, - }, - source: { - type: 'SELECT', - label: ' Source', - value: null, - isLeaf: true, - }, - context: { - type: 'RAW_JSON', - label: ' Context', - value: null, - isLeaf: true, - }, - workspaceMemberId: { - type: 'UUID', - label: ' Workspace Member Id', - value: '123e4567-e89b-12d3-a456-426614174000', - isLeaf: true, - }, - }, - isLeaf: false, - }, - deletedAt: { - icon: 'IconCalendarMinus', - type: 'DATE_TIME', - label: 'Deleted at', - value: '01/23/2025 15:16', - isLeaf: true, - }, - updatedAt: { - icon: 'IconCalendarClock', - type: 'DATE_TIME', - label: 'Last update', - value: '01/23/2025 15:16', - isLeaf: true, - }, - }, - object: { - icon: 'IconNotes', - label: 'Note', - value: 'A note', - isLeaf: true, - fieldIdName: 'id', - nameSingular: 'note', - }, - _outputSchemaType: 'RECORD', - }, - errorHandlingOptions: { - retryOnFailure: { - value: false, - }, - continueOnFailure: { - value: false, - }, - }, - }, - }, - { - id: 'd4a73172-3156-45bf-bc49-9358fbab2907', - name: 'Create Record', - type: 'CREATE_RECORD', - valid: false, - settings: { - input: { - objectName: 'opportunity', - objectRecord: { - name: 'Opportunity with {{trigger.properties.after.name}}', - stage: 'NEW', - }, - }, - outputSchema: { - fields: { - id: { - icon: 'Icon123', - type: 'UUID', - label: 'Id', - value: '123e4567-e89b-12d3-a456-426614174000', - isLeaf: true, - }, - name: { - icon: 'IconTargetArrow', - type: 'TEXT', - label: 'Name', - value: 'My text', - isLeaf: true, - }, - stage: { - icon: 'IconProgressCheck', - type: 'SELECT', - label: 'Stage', - value: null, - isLeaf: true, - }, - amount: { - icon: 'IconCurrencyDollar', - label: 'Amount', - value: { - amountMicros: { - type: 'NUMERIC', - label: ' Amount Micros', - value: null, - isLeaf: true, - }, - currencyCode: { - type: 'TEXT', - label: ' Currency Code', - value: 'My text', - isLeaf: true, - }, - }, - isLeaf: false, - }, - closeDate: { - icon: 'IconCalendarEvent', - type: 'DATE_TIME', - label: 'Close date', - value: '01/23/2025 15:16', - isLeaf: true, - }, - createdAt: { - icon: 'IconCalendar', - type: 'DATE_TIME', - label: 'Creation date', - value: '01/23/2025 15:16', - isLeaf: true, - }, - createdBy: { - icon: 'IconCreativeCommonsSa', - label: 'Created by', - value: { - name: { - type: 'TEXT', - label: ' Name', - value: 'My text', - isLeaf: true, - }, - source: { - type: 'SELECT', - label: ' Source', - value: null, - isLeaf: true, - }, - context: { - type: 'RAW_JSON', - label: ' Context', - value: null, - isLeaf: true, - }, - workspaceMemberId: { - type: 'UUID', - label: ' Workspace Member Id', - value: '123e4567-e89b-12d3-a456-426614174000', - isLeaf: true, - }, - }, - isLeaf: false, - }, - deletedAt: { - icon: 'IconCalendarMinus', - type: 'DATE_TIME', - label: 'Deleted at', - value: '01/23/2025 15:16', - isLeaf: true, - }, - updatedAt: { - icon: 'IconCalendarClock', - type: 'DATE_TIME', - label: 'Last update', - value: '01/23/2025 15:16', - isLeaf: true, - }, - }, - object: { - icon: 'IconTargetArrow', - label: 'Opportunity', - value: 'An opportunity', - isLeaf: true, - fieldIdName: 'id', - nameSingular: 'opportunity', - }, - _outputSchemaType: 'RECORD', - }, - errorHandlingOptions: { - retryOnFailure: { - value: false, - }, - continueOnFailure: { - value: false, - }, - }, - }, - }, - ], - trigger: { - type: 'DATABASE_EVENT', - settings: { - eventName: 'company.created', - outputSchema: { - userId: { - type: 'string', - label: 'User ID', - value: '977a8fb6-1b97-4203-a64b-5d3e12f8587c', - isLeaf: true, - }, - recordId: { - type: 'string', - label: 'Record ID', - value: '80d61929-1860-4f37-a639-b406a67f7800', - isLeaf: true, - }, - objectMetadata: { - label: 'Object Metadata', - value: { - id: { - label: ' Id', - value: '685ac06e-2351-421c-97ac-0bf4595819b8', - isLeaf: true, - }, - icon: { - label: ' Icon', - value: 'IconBuildingSkyscraper', - isLeaf: true, - }, - fields: { - label: ' Fields', - value: [ - { - id: 'c6e6cf7d-63af-4131-9f99-ce0f74fd7d10', - icon: 'IconBuildingSkyscraper', - name: 'name', - type: 'TEXT', - label: 'Name', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-4d99-4e2e-a84c-4a27837b1ece', - description: 'The company name', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: "''", - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'dbc86e47-d2cf-4094-9a57-90212efde6a0', - icon: 'IconLink', - name: 'domainName', - type: 'LINKS', - label: 'Domain Name', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: true, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-0c28-43d8-8ba5-3659924d3489', - description: - 'The company website URL. We use this url to fetch the company icon', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'c750e2c6-3de6-4c18-9876-6ba5ba970d42', - icon: 'IconUsers', - name: 'employees', - type: 'NUMBER', - label: 'Employees', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-8965-464a-8a75-74bafc152a0b', - description: 'Number of employees in the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'a4230bd8-66ec-4f2f-810b-1d02f9709bfa', - icon: 'IconBrandLinkedin', - name: 'linkedinLink', - type: 'LINKS', - label: 'Linkedin', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-ebeb-4beb-b9ad-6848036fb451', - description: 'The company Linkedin account', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '5fc216dc-7af4-4927-a026-0e5144afa436', - icon: 'IconBrandX', - name: 'xLink', - type: 'LINKS', - label: 'X', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-6f64-4fd9-9580-9c1991c7d8c3', - description: 'The company Twitter/X account', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'fba56220-3f40-4569-a500-35a4a312e473', - icon: 'IconMoneybag', - name: 'annualRecurringRevenue', - type: 'CURRENCY', - label: 'ARR', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-602a-495c-9776-f5d5b11d227b', - description: - 'Annual Recurring Revenue: The actual or estimated annual revenue of the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - amountMicros: null, - currencyCode: "''", - }, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '0b32256a-1bd2-40e1-98e0-74b400452aab', - icon: 'IconMap', - name: 'address', - type: 'ADDRESS', - label: 'Address', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-c5ce-4adc-b7b6-9c0979fc55e7', - description: 'Address of the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - addressLat: null, - addressLng: null, - addressCity: "''", - addressState: "''", - addressCountry: "''", - addressStreet1: "''", - addressStreet2: "''", - addressPostcode: "''", - }, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '214a5118-3ab5-4d2a-ac89-020f776831b3', - icon: 'IconTarget', - name: 'idealCustomerProfile', - type: 'BOOLEAN', - label: 'ICP', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-ba6b-438a-8213-2c5ba28d76a2', - description: - 'Ideal Customer Profile: Indicates whether the company is the most suitable and valuable customer for you', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: false, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'b66efff8-c0ef-4cb6-a5f1-3ea7fd0bfbb4', - icon: 'IconHierarchy2', - name: 'position', - type: 'POSITION', - label: 'Position', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-9b4e-462b-991d-a0ee33326454', - description: 'Company record position', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 0, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '943f218e-6061-4f61-ac3a-298ac14cef41', - icon: 'IconCreativeCommonsSa', - name: 'createdBy', - type: 'ACTOR', - label: 'Created by', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-fabc-451d-ab7d-412170916baa', - description: 'The creator of the record', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - name: "'System'", - source: "'MANUAL'", - context: {}, - }, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '8b1e9e2c-684f-4e9e-9bdf-e1f705f8ca03', - icon: 'IconUser', - name: 'searchVector', - type: 'TS_VECTOR', - label: 'Search vector', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '85c71601-72f9-4b7b-b343-d46100b2c74d', - description: 'Field used for full-text search', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '593dd556-69ab-4df7-aa2e-ab5e20eb7977', - icon: 'Icon123', - name: 'id', - type: 'UUID', - label: 'Id', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-eda0-4cee-9577-3eb357e3c22b', - description: 'Id', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 'uuid', - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '4ebb7bb9-d451-4433-880d-32cd3f3744df', - icon: 'IconCalendar', - name: 'createdAt', - type: 'DATE_TIME', - label: 'Creation date', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: { - displayFormat: 'RELATIVE', - }, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-66ac-4502-9975-e4d959c50311', - description: 'Creation date', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 'now', - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '39526b16-7d21-4a91-a70c-bca108b27989', - icon: 'IconCalendarClock', - name: 'updatedAt', - type: 'DATE_TIME', - label: 'Last update', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: { - displayFormat: 'RELATIVE', - }, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: false, - standardId: '20202020-d767-4622-bdcf-d8a084834d86', - description: 'Last time the record was changed', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: 'now', - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '55e17b77-84f7-4b8a-bef5-be65f783d9f8', - icon: 'IconCalendarMinus', - name: 'deletedAt', - type: 'DATE_TIME', - label: 'Deleted at', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: { - displayFormat: 'RELATIVE', - }, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-b9a7-48d8-8387-b9a3090a50ec', - description: 'Date when the record was deleted', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '11a04849-150b-4af0-9332-b4a9ba693b17', - icon: 'IconUsers', - name: 'people', - type: 'RELATION', - label: 'People', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-3213-4ddf-9494-6422bcff8d7c', - description: 'People linked to the company.', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'a6f9558c-76df-49d1-9011-16f2f3b8dbe2', - icon: 'IconUserCircle', - name: 'accountOwnerId', - type: 'UUID', - label: 'Account Owner id (foreign key)', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-cce0-424e-8028-91f50eb9c768', - description: - 'Your team member responsible for managing the company account id foreign key', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '20e60c1f-2dd8-4f1f-a1eb-b4c179cbcd4a', - icon: 'IconUserCircle', - name: 'accountOwner', - type: 'RELATION', - label: 'Account Owner', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-95b8-4e10-9881-edb5d4765f9d', - description: - 'Your team member responsible for managing the company account', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: 'c0d5849e-f4cd-4f40-81ff-5c8c82e49c07', - icon: 'IconCheckbox', - name: 'taskTargets', - type: 'RELATION', - label: 'Tasks', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-cb17-4a61-8f8f-3be6730480de', - description: 'Tasks tied to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '7dd1b1ac-9765-423e-ac74-050b2b730885', - icon: 'IconNotes', - name: 'noteTargets', - type: 'RELATION', - label: 'Notes', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-bae0-4556-a74a-a9c686f77a88', - description: 'Notes tied to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '7524cc63-2522-4c70-8b12-21fe2fe8de26', - icon: 'IconTargetArrow', - name: 'opportunities', - type: 'RELATION', - label: 'Opportunities', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-add3-4658-8e23-d70dccb6d0ec', - description: 'Opportunities linked to the company.', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '45b5decf-cd19-4a2e-a321-b0c7ad3c1407', - icon: 'IconHeart', - name: 'favorites', - type: 'RELATION', - label: 'Favorites', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-4d1d-41ac-b13b-621631298d55', - description: 'Favorites linked to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '0ae7a621-f443-47f7-b255-82d2e589ca21', - icon: 'IconFileImport', - name: 'attachments', - type: 'RELATION', - label: 'Attachments', - options: null, - isActive: true, - isCustom: false, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-c1b5-4120-b0f0-987ca401ed53', - description: 'Attachments linked to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '038ca1af-7f15-460d-b111-b71062a8a6be', - icon: 'IconIconTimelineEvent', - name: 'timelineActivities', - type: 'RELATION', - label: 'Timeline Activities', - options: null, - isActive: true, - isCustom: false, - isSystem: true, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:09.390Z', - updatedAt: '2025-03-05T15:41:09.390Z', - isNullable: true, - standardId: '20202020-0414-4daf-9c0d-64fe7b27f89f', - description: - 'Timeline Activities linked to the company', - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '4f069436-1c42-4ec4-8dda-6b22011fc75a', - icon: 'IconAdCircle', - name: 'tagline', - type: 'TEXT', - label: 'Tagline', - options: null, - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.009Z', - updatedAt: '2025-03-05T15:41:12.009Z', - isNullable: false, - standardId: null, - description: "Company's Tagline", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: "''", - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '49e40a03-3f21-49d5-b03a-439bbc9ab73b', - icon: 'IconVideo', - name: 'introVideo', - type: 'LINKS', - label: 'Intro Video', - options: null, - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.011Z', - updatedAt: '2025-03-05T15:41:12.011Z', - isNullable: true, - standardId: null, - description: "Company's Intro Video", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: { - primaryLinkUrl: "''", - secondaryLinks: "'[]'", - primaryLinkLabel: "''", - }, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '8a2883df-3e19-4d52-9309-d636767d1b6a', - icon: 'IconHome', - name: 'workPolicy', - type: 'MULTI_SELECT', - label: 'Work Policy', - options: [ - { - id: '4554330a-c3db-4042-b941-c2e299734d12', - color: 'green', - label: 'On-Site', - value: 'ON_SITE', - position: 0, - }, - { - id: 'abfde6f9-64d5-430a-adb3-bea2f403d9a4', - color: 'turquoise', - label: 'Hybrid', - value: 'HYBRID', - position: 1, - }, - { - id: '8eaca902-05c5-4087-86c0-30c664c2c4f5', - color: 'sky', - label: 'Remote Work', - value: 'REMOTE_WORK', - position: 2, - }, - ], - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.013Z', - updatedAt: '2025-03-05T15:41:12.013Z', - isNullable: true, - standardId: null, - description: "Company's Work Policy", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: null, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - { - id: '26a67635-7d43-47f0-b895-1c8194a7fa30', - icon: 'IconBrandVisa', - name: 'visaSponsorship', - type: 'BOOLEAN', - label: 'Visa Sponsorship', - options: null, - isActive: true, - isCustom: true, - isSystem: false, - isUnique: false, - settings: null, - createdAt: '2025-03-05T15:41:12.014Z', - updatedAt: '2025-03-05T15:41:12.014Z', - isNullable: true, - standardId: null, - description: "Company's Visa Sponsorship Policy", - workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419', - defaultValue: false, - objectMetadataId: - '685ac06e-2351-421c-97ac-0bf4595819b8', - isLabelSyncedWithName: false, - relationTargetFieldMetadataId: null, - relationTargetObjectMetadataId: null, - }, - ], - isLeaf: true, - }, - isActive: { - label: ' Is Active', - value: true, - isLeaf: true, - }, - isCustom: { - label: ' Is Custom', - value: false, - isLeaf: true, - }, - isRemote: { - label: ' Is Remote', - value: false, - isLeaf: true, - }, - isSystem: { - label: ' Is System', - value: false, - isLeaf: true, - }, - shortcut: { - label: ' Shortcut', - value: 'C', - isLeaf: true, - }, - createdAt: { - label: ' Created At', - value: '2025-03-05T15:41:09.390Z', - isLeaf: true, - }, - updatedAt: { - label: ' Updated At', - value: '2025-03-05T15:41:09.390Z', - isLeaf: true, - }, - namePlural: { - label: ' Name Plural', - value: 'companies', - isLeaf: true, - }, - standardId: { - label: ' Standard Id', - value: '20202020-b374-4779-a561-80086cb2e17f', - isLeaf: true, - }, - description: { - label: ' Description', - value: 'A company', - isLeaf: true, - }, - labelPlural: { - label: ' Label Plural', - value: 'Companies', - isLeaf: true, - }, - workspaceId: { - label: ' Workspace Id', - value: '20202020-1c25-4d02-bf25-6aeccf7ea419', - isLeaf: true, - }, - dataSourceId: { - label: ' Data Source Id', - value: 'f20df2e6-420e-40e0-a4ca-68846bbe6c92', - isLeaf: true, - }, - isSearchable: { - label: ' Is Searchable', - value: true, - isLeaf: true, - }, - nameSingular: { - label: ' Name Singular', - value: 'company', - isLeaf: true, - }, - isAuditLogged: { - label: ' Is Audit Logged', - value: true, - isLeaf: true, - }, - labelSingular: { - label: ' Label Singular', - value: 'Company', - isLeaf: true, - }, - targetTableName: { - label: ' Target Table Name', - value: 'DEPRECATED', - isLeaf: true, - }, - duplicateCriteria: { - label: ' Duplicate Criteria', - value: [['name'], ['domainNamePrimaryLinkUrl']], - isLeaf: true, - }, - isLabelSyncedWithName: { - label: ' Is Label Synced With Name', - value: false, - isLeaf: true, - }, - imageIdentifierFieldMetadataId: { - label: ' Image Identifier Field Metadata Id', - value: null, - isLeaf: true, - }, - labelIdentifierFieldMetadataId: { - label: ' Label Identifier Field Metadata Id', - value: 'c6e6cf7d-63af-4131-9f99-ce0f74fd7d10', - isLeaf: true, - }, - }, - isLeaf: false, - }, - 'properties.after': { - label: 'Record Fields', - value: { - fields: { - id: { - icon: 'Icon123', - type: 'UUID', - label: 'Id', - value: '123e4567-e89b-12d3-a456-426614174000', - isLeaf: true, - }, - name: { - icon: 'IconBuildingSkyscraper', - type: 'TEXT', - label: 'Name', - value: 'My text', - isLeaf: true, - }, - xLink: { - icon: 'IconBrandX', - label: 'X', - value: { - primaryLinkUrl: { - type: 'TEXT', - label: ' Primary Link Url', - value: 'My text', - isLeaf: true, - }, - secondaryLinks: { - type: 'RAW_JSON', - label: ' Secondary Links', - value: null, - isLeaf: true, - }, - primaryLinkLabel: { - type: 'TEXT', - label: ' Primary Link Label', - value: 'My text', - isLeaf: true, - }, - }, - isLeaf: false, - }, - address: { - icon: 'IconMap', - label: 'Address', - value: { - addressLat: { - type: 'NUMERIC', - label: ' Address Lat', - value: null, - isLeaf: true, - }, - addressLng: { - type: 'NUMERIC', - label: ' Address Lng', - value: null, - isLeaf: true, - }, - addressCity: { - type: 'TEXT', - label: ' Address City', - value: 'My text', - isLeaf: true, - }, - addressState: { - type: 'TEXT', - label: ' Address State', - value: 'My text', - isLeaf: true, - }, - addressCountry: { - type: 'TEXT', - label: ' Address Country', - value: 'My text', - isLeaf: true, - }, - addressStreet1: { - type: 'TEXT', - label: ' Address Street1', - value: 'My text', - isLeaf: true, - }, - addressStreet2: { - type: 'TEXT', - label: ' Address Street2', - value: 'My text', - isLeaf: true, - }, - addressPostcode: { - type: 'TEXT', - label: ' Address Postcode', - value: 'My text', - isLeaf: true, - }, - }, - isLeaf: false, - }, - tagline: { - icon: 'IconAdCircle', - type: 'TEXT', - label: 'Tagline', - value: 'My text', - isLeaf: true, - }, - createdAt: { - icon: 'IconCalendar', - type: 'DATE_TIME', - label: 'Creation date', - value: '01/23/2025 15:16', - isLeaf: true, - }, - createdBy: { - icon: 'IconCreativeCommonsSa', - label: 'Created by', - value: { - name: { - type: 'TEXT', - label: ' Name', - value: 'My text', - isLeaf: true, - }, - source: { - type: 'SELECT', - label: ' Source', - value: null, - isLeaf: true, - }, - context: { - type: 'RAW_JSON', - label: ' Context', - value: null, - isLeaf: true, - }, - workspaceMemberId: { - type: 'UUID', - label: ' Workspace Member Id', - value: '123e4567-e89b-12d3-a456-426614174000', - isLeaf: true, - }, - }, - isLeaf: false, - }, - deletedAt: { - icon: 'IconCalendarMinus', - type: 'DATE_TIME', - label: 'Deleted at', - value: '01/23/2025 15:16', - isLeaf: true, - }, - employees: { - icon: 'IconUsers', - type: 'NUMBER', - label: 'Employees', - value: 20, - isLeaf: true, - }, - updatedAt: { - icon: 'IconCalendarClock', - type: 'DATE_TIME', - label: 'Last update', - value: '01/23/2025 15:16', - isLeaf: true, - }, - domainName: { - icon: 'IconLink', - label: 'Domain Name', - value: { - primaryLinkUrl: { - type: 'TEXT', - label: ' Primary Link Url', - value: 'My text', - isLeaf: true, - }, - secondaryLinks: { - type: 'RAW_JSON', - label: ' Secondary Links', - value: null, - isLeaf: true, - }, - primaryLinkLabel: { - type: 'TEXT', - label: ' Primary Link Label', - value: 'My text', - isLeaf: true, - }, - }, - isLeaf: false, - }, - introVideo: { - icon: 'IconVideo', - label: 'Intro Video', - value: { - primaryLinkUrl: { - type: 'TEXT', - label: ' Primary Link Url', - value: 'My text', - isLeaf: true, - }, - secondaryLinks: { - type: 'RAW_JSON', - label: ' Secondary Links', - value: null, - isLeaf: true, - }, - primaryLinkLabel: { - type: 'TEXT', - label: ' Primary Link Label', - value: 'My text', - isLeaf: true, - }, - }, - isLeaf: false, - }, - workPolicy: { - icon: 'IconHome', - type: 'MULTI_SELECT', - label: 'Work Policy', - value: null, - isLeaf: true, - }, - linkedinLink: { - icon: 'IconBrandLinkedin', - label: 'Linkedin', - value: { - primaryLinkUrl: { - type: 'TEXT', - label: ' Primary Link Url', - value: 'My text', - isLeaf: true, - }, - secondaryLinks: { - type: 'RAW_JSON', - label: ' Secondary Links', - value: null, - isLeaf: true, - }, - primaryLinkLabel: { - type: 'TEXT', - label: ' Primary Link Label', - value: 'My text', - isLeaf: true, - }, - }, - isLeaf: false, - }, - visaSponsorship: { - icon: 'IconBrandVisa', - type: 'BOOLEAN', - label: 'Visa Sponsorship', - value: true, - isLeaf: true, - }, - idealCustomerProfile: { - icon: 'IconTarget', - type: 'BOOLEAN', - label: 'ICP', - value: true, - isLeaf: true, - }, - annualRecurringRevenue: { - icon: 'IconMoneybag', - label: 'ARR', - value: { - amountMicros: { - type: 'NUMERIC', - label: ' Amount Micros', - value: null, - isLeaf: true, - }, - currencyCode: { - type: 'TEXT', - label: ' Currency Code', - value: 'My text', - isLeaf: true, - }, - }, - isLeaf: false, - }, - }, - object: { - icon: 'IconBuildingSkyscraper', - label: 'Company', - value: 'A company', - isLeaf: true, - fieldIdName: 'id', - nameSingular: 'company', - }, - _outputSchemaType: 'RECORD', - }, - isLeaf: false, - }, - workspaceMemberId: { - type: 'string', - label: 'Workspace Member ID', - value: '53562519-b9e8-44f1-8dd1-e247cc7ef584', - isLeaf: true, - }, - }, - }, - }, - }, - stepsOutput: { - '212a171a-f887-4213-8892-e39c2a3ecc30': { - result: { - userId: ['20202020', '9e3b', '46d4', 'a556', '88b9ddc2b034'], - }, - }, - '753b124e-f427-44a4-ab08-bacfe9c2f746': { - result: { - id: '0455ca41-bae1-4a3a-968c-b268a4e809bb', - title: 'Proposal for ', - bodyV2: { - markdown: '', - blocknote: '', - }, - position: 0, - createdAt: '2025-03-06T12:15:43.371Z', - createdBy: { - name: 'Workflow', - source: 'WORKFLOW', - context: {}, - workspaceMemberId: null, - }, - deletedAt: null, - updatedAt: '2025-03-06T12:15:43.371Z', - searchVector: "'for':2 'proposal':1", - }, - }, - 'a01b2953-9aa7-4d9a-aded-8e9bafbd6c30': { - result: { - date: '2025-03-06T12:15:43.358Z', - }, - }, - 'd4a73172-3156-45bf-bc49-9358fbab2907': { - result: { - id: 'f76b6058-2c8b-4bfa-86c1-4a4d39de3ee9', - name: 'Opportunity with ', - stage: 'NEW', - amount: { - amountMicros: null, - currencyCode: '', - }, - position: 0, - closeDate: null, - companyId: null, - createdAt: '2025-03-06T12:15:43.386Z', - createdBy: { - name: 'Workflow', - source: 'WORKFLOW', - context: {}, - workspaceMemberId: null, - }, - deletedAt: null, - updatedAt: '2025-03-06T12:15:43.386Z', - searchVector: "'opportunity':1 'with':2", - pointOfContactId: null, - }, - }, - }, - }, state: { flow: { steps: [ diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/1-1/1-1-migrate-workflow-run-state.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/1-1/1-1-migrate-workflow-run-state.command.ts index 6daf6ed30..dbb35116a 100644 --- a/packages/twenty-server/src/database/commands/upgrade-version-command/1-1/1-1-migrate-workflow-run-state.command.ts +++ b/packages/twenty-server/src/database/commands/upgrade-version-command/1-1/1-1-migrate-workflow-run-state.command.ts @@ -95,11 +95,12 @@ export class MigrateWorkflowRunStatesCommand extends ActiveOrSuspendedWorkspaces ? { where: { startedAt: MoreThan(this.afterDate) } } : {}; - const workflowRuns = await workflowRunRepository.find({ + const workflowRuns = (await workflowRunRepository.find({ ...findOption, skip: offset * this.chunkSize, take: this.chunkSize, - }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + })) as any[]; // We type as any as workflowRun output has been removed since 1.1.0 release for (const workflowRun of workflowRuns) { const output = workflowRun.output; diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/1-2/1-2-remove-workflow-runs-without-state.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/1-2/1-2-remove-workflow-runs-without-state.command.ts new file mode 100644 index 000000000..99ca651a2 --- /dev/null +++ b/packages/twenty-server/src/database/commands/upgrade-version-command/1-2/1-2-remove-workflow-runs-without-state.command.ts @@ -0,0 +1,39 @@ +import { InjectRepository } from '@nestjs/typeorm'; + +import { Command } from 'nest-commander'; +import { IsNull, Repository } from 'typeorm'; + +import { + ActiveOrSuspendedWorkspacesMigrationCommandRunner, + RunOnWorkspaceArgs, +} from 'src/database/commands/command-runners/active-or-suspended-workspaces-migration.command-runner'; +import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity'; +import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager'; +import { WorkflowRunWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-run.workspace-entity'; + +@Command({ + name: 'migrate:1-2:remove-workflow-runs-without-state', + description: 'Remove workflow runs without state.', +}) +export class RemoveWorkflowRunsWithoutState extends ActiveOrSuspendedWorkspacesMigrationCommandRunner { + constructor( + @InjectRepository(Workspace, 'core') + protected readonly workspaceRepository: Repository, + protected readonly twentyORMGlobalManager: TwentyORMGlobalManager, + ) { + super(workspaceRepository, twentyORMGlobalManager); + } + + override async runOnWorkspace({ + workspaceId, + }: RunOnWorkspaceArgs): Promise { + const workflowRunRepository = + await this.twentyORMGlobalManager.getRepositoryForWorkspace( + workspaceId, + 'workflowRun', + { shouldBypassPermissionChecks: true }, + ); + + await workflowRunRepository.delete({ state: IsNull() }); + } +} diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/1-2/1-2-upgrade-version-command.module.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/1-2/1-2-upgrade-version-command.module.ts index 91febdf84..11574b2aa 100644 --- a/packages/twenty-server/src/database/commands/upgrade-version-command/1-2/1-2-upgrade-version-command.module.ts +++ b/packages/twenty-server/src/database/commands/upgrade-version-command/1-2/1-2-upgrade-version-command.module.ts @@ -1,8 +1,12 @@ import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; + +import { RemoveWorkflowRunsWithoutState } from 'src/database/commands/upgrade-version-command/1-2/1-2-remove-workflow-runs-without-state.command'; +import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity'; @Module({ - imports: [], - providers: [], - exports: [], + imports: [TypeOrmModule.forFeature([Workspace], 'core')], + providers: [RemoveWorkflowRunsWithoutState], + exports: [RemoveWorkflowRunsWithoutState], }) export class V1_2_UpgradeVersionCommandModule {} diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/upgrade.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/upgrade.command.ts index bb0bfdf39..649bf2f1a 100644 --- a/packages/twenty-server/src/database/commands/upgrade-version-command/upgrade.command.ts +++ b/packages/twenty-server/src/database/commands/upgrade-version-command/upgrade.command.ts @@ -31,6 +31,7 @@ import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity'; import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager'; import { SyncWorkspaceMetadataCommand } from 'src/engine/workspace-manager/workspace-sync-metadata/commands/sync-workspace-metadata.command'; import { compareVersionMajorAndMinor } from 'src/utils/version/compare-version-minor-and-major'; +import { RemoveWorkflowRunsWithoutState } from 'src/database/commands/upgrade-version-command/1-2/1-2-remove-workflow-runs-without-state.command'; const execPromise = promisify(exec); @@ -149,6 +150,7 @@ export class UpgradeCommand extends UpgradeCommandRunner { protected readonly addEnqueuedStatusToWorkflowRunCommand: AddEnqueuedStatusToWorkflowRunCommand, // 1.2 Commands + protected readonly removeWorkflowRunsWithoutState: RemoveWorkflowRunsWithoutState, // 1.3 Commands ) { @@ -202,7 +204,7 @@ export class UpgradeCommand extends UpgradeCommandRunner { }; const commands_120: VersionCommands = { - beforeSyncMetadata: [], + beforeSyncMetadata: [this.removeWorkflowRunsWithoutState], afterSyncMetadata: [], }; diff --git a/packages/twenty-server/src/modules/workflow/common/standard-objects/workflow-run.workspace-entity.ts b/packages/twenty-server/src/modules/workflow/common/standard-objects/workflow-run.workspace-entity.ts index 27089393e..1112eabd5 100644 --- a/packages/twenty-server/src/modules/workflow/common/standard-objects/workflow-run.workspace-entity.ts +++ b/packages/twenty-server/src/modules/workflow/common/standard-objects/workflow-run.workspace-entity.ts @@ -161,27 +161,6 @@ export class WorkflowRunWorkspaceEntity extends BaseWorkspaceEntity { }) createdBy: ActorMetadata; - @WorkspaceField({ - standardId: WORKFLOW_RUN_STANDARD_FIELD_IDS.output, - type: FieldMetadataType.RAW_JSON, - label: msg`Output`, - description: msg`Json object to provide output of the workflow run`, - icon: 'IconText', - }) - @WorkspaceIsNullable() - output: WorkflowRunOutput | null; - - @WorkspaceField({ - standardId: WORKFLOW_RUN_STANDARD_FIELD_IDS.context, - type: FieldMetadataType.RAW_JSON, - label: msg`Context`, - description: msg`Context`, - icon: 'IconHierarchy2', - }) - @WorkspaceIsNullable() - // eslint-disable-next-line @typescript-eslint/no-explicit-any - context: Record | null; - @WorkspaceField({ standardId: WORKFLOW_RUN_STANDARD_FIELD_IDS.state, type: FieldMetadataType.RAW_JSON, @@ -189,8 +168,7 @@ export class WorkflowRunWorkspaceEntity extends BaseWorkspaceEntity { description: msg`State of the workflow run`, icon: 'IconHierarchy2', }) - @WorkspaceIsNullable() - state: WorkflowRunState | null; + state: WorkflowRunState; @WorkspaceField({ standardId: WORKFLOW_RUN_STANDARD_FIELD_IDS.position, diff --git a/packages/twenty-server/src/modules/workflow/workflow-runner/jobs/run-workflow.job.ts b/packages/twenty-server/src/modules/workflow/workflow-runner/jobs/run-workflow.job.ts index 5af6eb2ae..37c912779 100644 --- a/packages/twenty-server/src/modules/workflow/workflow-runner/jobs/run-workflow.job.ts +++ b/packages/twenty-server/src/modules/workflow/workflow-runner/jobs/run-workflow.job.ts @@ -103,12 +103,9 @@ export class RunWorkflowJob { triggerType: workflowVersion.trigger.type, }); - const triggerPayload = workflowRun.context?.trigger ?? {}; - await this.workflowRunWorkspaceService.startWorkflowRun({ workflowRunId, workspaceId, - payload: triggerPayload, }); await this.throttleExecution(workflowVersion.workflowId); diff --git a/packages/twenty-server/src/modules/workflow/workflow-runner/workflow-run/workflow-run.workspace-service.ts b/packages/twenty-server/src/modules/workflow/workflow-runner/workflow-run/workflow-run.workspace-service.ts index 9b999f73e..0b57e7a0e 100644 --- a/packages/twenty-server/src/modules/workflow/workflow-runner/workflow-run/workflow-run.workspace-service.ts +++ b/packages/twenty-server/src/modules/workflow/workflow-runner/workflow-run/workflow-run.workspace-service.ts @@ -40,15 +40,14 @@ export class WorkflowRunWorkspaceService { workflowVersionId, createdBy, workflowRunId, - context, status, + triggerPayload, }: { workflowVersionId: string; createdBy: ActorMetadata; workflowRunId?: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - context: Record; status: WorkflowRunStatus.NOT_STARTED | WorkflowRunStatus.ENQUEUED; + triggerPayload: object; }) { const workspaceId = this.scopedWorkspaceContextFactory.create()?.workspaceId; @@ -108,7 +107,7 @@ export class WorkflowRunWorkspaceService { workspaceId, }); - const initState = this.getInitState(workflowVersion); + const initState = this.getInitState(workflowVersion, triggerPayload); const workflowRun = workflowRunRepository.create({ id: workflowRunId ?? v4(), @@ -119,11 +118,6 @@ export class WorkflowRunWorkspaceService { status, position, state: initState, - output: { - ...initState, - stepsOutput: {}, - }, - context, }); await workflowRunRepository.insert(workflowRun); @@ -135,11 +129,9 @@ export class WorkflowRunWorkspaceService { async startWorkflowRun({ workflowRunId, workspaceId, - payload, }: { workflowRunId: string; workspaceId: string; - payload: object; }) { const workflowRunToUpdate = await this.getWorkflowRunOrFail({ workflowRunId, @@ -159,29 +151,17 @@ export class WorkflowRunWorkspaceService { const partialUpdate = { status: WorkflowRunStatus.RUNNING, startedAt: new Date().toISOString(), - output: { - ...workflowRunToUpdate.output, - stepsOutput: { - trigger: { - result: payload, - }, - }, - }, state: { ...workflowRunToUpdate.state, stepInfos: { ...workflowRunToUpdate.state?.stepInfos, trigger: { + result: {}, + ...workflowRunToUpdate.state?.stepInfos.trigger, status: StepStatus.SUCCESS, - result: payload, }, }, }, - context: payload - ? { - trigger: payload, - } - : (workflowRunToUpdate.context ?? {}), }; await this.updateWorkflowRun({ workflowRunId, workspaceId, partialUpdate }); @@ -207,10 +187,6 @@ export class WorkflowRunWorkspaceService { const partialUpdate = { status, endedAt: new Date().toISOString(), - output: { - ...workflowRunToUpdate.output, - error, - }, state: { ...workflowRunToUpdate.state, workflowRunError: error, @@ -279,16 +255,6 @@ export class WorkflowRunWorkspaceService { }); const partialUpdate = { - output: { - flow: workflowRunToUpdate.output?.flow ?? { - trigger: undefined, - steps: [], - }, - stepsOutput: { - ...(workflowRunToUpdate.output?.stepsOutput ?? {}), - [stepOutput.id]: stepOutput.output, - }, - }, state: { ...workflowRunToUpdate.state, stepInfos: { @@ -301,14 +267,6 @@ export class WorkflowRunWorkspaceService { }, }, }, - ...(stepStatus === StepStatus.SUCCESS - ? { - context: { - ...workflowRunToUpdate.context, - [stepOutput.id]: stepOutput.output.result, - }, - } - : {}), }; await this.updateWorkflowRun({ workflowRunId, workspaceId, partialUpdate }); @@ -339,18 +297,11 @@ export class WorkflowRunWorkspaceService { ); } - const updatedSteps = workflowRunToUpdate.output?.flow?.steps?.map( + const updatedSteps = workflowRunToUpdate.state?.flow?.steps?.map( (existingStep) => (step.id === existingStep.id ? step : existingStep), ); const partialUpdate = { - output: { - ...(workflowRunToUpdate.output ?? {}), - flow: { - ...(workflowRunToUpdate.output?.flow ?? {}), - steps: updatedSteps, - }, - }, state: { ...workflowRunToUpdate.state, flow: { @@ -406,6 +357,7 @@ export class WorkflowRunWorkspaceService { private getInitState( workflowVersion: WorkflowVersionWorkspaceEntity, + triggerPayload: object, ): WorkflowRunState | undefined { if ( !isDefined(workflowVersion.trigger) || @@ -420,7 +372,7 @@ export class WorkflowRunWorkspaceService { steps: workflowVersion.steps, }, stepInfos: { - trigger: { status: StepStatus.NOT_STARTED }, + trigger: { status: StepStatus.NOT_STARTED, result: triggerPayload }, ...Object.fromEntries( workflowVersion.steps.map((step) => [ step.id, diff --git a/packages/twenty-server/src/modules/workflow/workflow-runner/workspace-services/workflow-runner.workspace-service.ts b/packages/twenty-server/src/modules/workflow/workflow-runner/workspace-services/workflow-runner.workspace-service.ts index 57c0b6e69..137a7c318 100644 --- a/packages/twenty-server/src/modules/workflow/workflow-runner/workspace-services/workflow-runner.workspace-service.ts +++ b/packages/twenty-server/src/modules/workflow/workflow-runner/workspace-services/workflow-runner.workspace-service.ts @@ -75,9 +75,7 @@ export class WorkflowRunnerWorkspaceService { status: shouldEnqueueWorkflowRun ? WorkflowRunStatus.ENQUEUED : WorkflowRunStatus.NOT_STARTED, - context: { - trigger: payload, - }, + triggerPayload: payload, }); if (shouldEnqueueWorkflowRun) {