@lunnoa/client 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -715,7 +715,7 @@ interface paths {
715
715
  put?: never;
716
716
  /**
717
717
  * Upsert a workflow by slug from a linear step list
718
- * @description Creates or updates a workflow identified by workspace-scoped `slug`. Builds a minimal valid graph (manual trigger → linear catalogue-action steps). Marks `managedByCode` by default. Prefer the CLI (`npx @lunnoa/client workflows deploy`) over calling this from application code.
718
+ * @description Creates or updates a workflow identified by workspace-scoped `slug`. Builds a minimal valid graph (one catalogue trigger, Manually Run when omitted, then linear catalogue-action steps). Marks `managedByCode` by default. Prefer the CLI (`npx @lunnoa/client workflows deploy`) over calling this from application code.
719
719
  */
720
720
  post: operations["WorkflowsController_upsertBySlug"];
721
721
  delete?: never;
@@ -2299,13 +2299,18 @@ interface components {
2299
2299
  requestedCount: number;
2300
2300
  };
2301
2301
  UpsertWorkflowStepDto: {
2302
+ /**
2303
+ * @description Name later steps use in ={{step:<key>,path}}. Keyed steps keep their node id across deploys. "trigger" is reserved.
2304
+ * @example loadCase
2305
+ */
2306
+ key?: string;
2302
2307
  /** @description Workflow app id (catalogue slug). */
2303
2308
  appId: string;
2304
2309
  /** @description Catalogue action id. */
2305
2310
  actionId: string;
2306
2311
  /** @description Connection instance UUID for this step. */
2307
2312
  connectionId?: string;
2308
- /** @description Action input / config fields. */
2313
+ /** @description Action input / config fields. String values may use ={{step:trigger,field}} or ={{step:<key>,path,to,value}}. */
2309
2314
  input?: {
2310
2315
  [key: string]: unknown;
2311
2316
  };
@@ -2314,6 +2319,41 @@ interface components {
2314
2319
  /** @description Step description. */
2315
2320
  description?: string;
2316
2321
  };
2322
+ UpsertWorkflowTriggerInputFieldDto: {
2323
+ /** @description Field id. Callers pass this key to workflows.execute. */
2324
+ id: string;
2325
+ /** @description Label shown on the Manually Run form. */
2326
+ label?: string;
2327
+ description?: string;
2328
+ /** @description text, number, date, or select. Defaults to text. */
2329
+ inputType?: string;
2330
+ /** @description true, or { missingMessage, missingStatus }. */
2331
+ required?: boolean | {
2332
+ [key: string]: unknown;
2333
+ };
2334
+ /** @description Used when the caller omits the field. */
2335
+ defaultValue?: unknown;
2336
+ selectOptions?: {
2337
+ [key: string]: unknown;
2338
+ }[];
2339
+ };
2340
+ UpsertWorkflowTriggerDto: {
2341
+ /** @description Catalogue trigger id, for example flow-control_trigger_manual. */
2342
+ triggerId: string;
2343
+ /** @description Workflow app id. Inferred from triggerId when it contains _trigger_. */
2344
+ appId?: string;
2345
+ /** @description Connection instance UUID for this trigger. */
2346
+ connectionId?: string;
2347
+ /** @description Trigger config fields from the catalogue inputConfig. */
2348
+ input?: {
2349
+ [key: string]: unknown;
2350
+ };
2351
+ /** @description Manual-trigger fields. Stored on the trigger as customInputConfig. */
2352
+ inputs?: components["schemas"]["UpsertWorkflowTriggerInputFieldDto"][];
2353
+ /** @description Display name for the trigger node. */
2354
+ name?: string;
2355
+ description?: string;
2356
+ };
2317
2357
  UpsertWorkflowBySlugDto: {
2318
2358
  /**
2319
2359
  * @description Stable workspace-scoped slug (lowercase, digits, hyphens). Used as the upsert key.
@@ -2325,6 +2365,8 @@ interface components {
2325
2365
  description?: string;
2326
2366
  /** @description Whether the workflow is active. */
2327
2367
  isActive?: boolean;
2368
+ /** @description Catalogue trigger. Omit for a Manually Run trigger with no input fields. */
2369
+ trigger?: components["schemas"]["UpsertWorkflowTriggerDto"];
2328
2370
  /** @description Linear catalogue-action steps (v1; no branches). */
2329
2371
  steps: components["schemas"]["UpsertWorkflowStepDto"][];
2330
2372
  /** @description Marks the row as managed by code (CLI / SDK). Defaults to true on this endpoint. */
@@ -3427,6 +3469,8 @@ interface components {
3427
3469
  executionPath?: components["schemas"]["ExecutionPathStepDto"][];
3428
3470
  };
3429
3471
  RunStepDto: {
3472
+ /** @description Name later steps use in ={{step:<key>,path}}. Ad-hoc runs have no trigger. */
3473
+ key?: string;
3430
3474
  /** @description Workflow app id (catalogue slug), e.g. `http`, `gmail`. */
3431
3475
  appId: string;
3432
3476
  /** @description Action id within the app, e.g. `http_action_send-request`. Discover via GET /workflow-apps. */
@@ -6605,6 +6649,7 @@ declare const DEFINE_KINDS: {
6605
6649
  readonly connection: "connection";
6606
6650
  readonly aiConnection: "aiConnection";
6607
6651
  readonly action: "action";
6652
+ readonly trigger: "trigger";
6608
6653
  readonly workflow: "workflow";
6609
6654
  readonly agent: "agent";
6610
6655
  readonly entityType: "entityType";
@@ -6640,10 +6685,52 @@ interface ActionDefinition {
6640
6685
  name?: string;
6641
6686
  description?: string;
6642
6687
  }
6688
+ /** One field on a Manually Run trigger. Stored as `customInputConfig`. */
6689
+ interface TriggerInputFieldDefinition {
6690
+ /** Field id. Callers pass this key to `workflows.execute`. */
6691
+ id: string;
6692
+ label?: string;
6693
+ description?: string;
6694
+ /** `text`, `number`, `date`, or `select`. Defaults to `text` on deploy. */
6695
+ inputType?: string;
6696
+ required?: boolean | {
6697
+ missingMessage?: string;
6698
+ missingStatus?: string;
6699
+ };
6700
+ defaultValue?: unknown;
6701
+ selectOptions?: Array<{
6702
+ label?: string;
6703
+ value?: string;
6704
+ }>;
6705
+ }
6706
+ /** Ref to a catalogue trigger. Credentials stay on the connection, when one is set. */
6707
+ interface TriggerDefinition {
6708
+ kind: typeof DEFINE_KINDS.trigger;
6709
+ /**
6710
+ * Catalogue trigger id, e.g. `flow-control_trigger_manual`.
6711
+ * Discover with `apps get <appId> --json` (`triggers[].triggerId`).
6712
+ */
6713
+ id: string;
6714
+ /** Workflow app id. Inferred from `id` when it matches `{app}_trigger_…`. */
6715
+ appId?: string;
6716
+ /** Optional Connection ref. Omit to let the platform resolve. */
6717
+ connection?: ConnectionDefinition;
6718
+ /** Catalogue trigger config (webhook method, schedule, app trigger fields). */
6719
+ input?: Record<string, unknown>;
6720
+ /** Manual-trigger fields. Stored as `customInputConfig`. */
6721
+ inputs?: TriggerInputFieldDefinition[];
6722
+ name?: string;
6723
+ description?: string;
6724
+ }
6643
6725
  interface WorkflowStepDefinition {
6726
+ /**
6727
+ * Name later steps use with `ref.step(key, ...)`. Keyed steps keep their
6728
+ * node id across deploys. `trigger` is reserved.
6729
+ */
6730
+ key?: string;
6644
6731
  /** Action definition (or inline action-shaped object). */
6645
6732
  use: ActionDefinition;
6646
- /** Per-step input overrides. */
6733
+ /** Per-step input overrides. Values may contain `ref.trigger` / `ref.step`. */
6647
6734
  input?: Record<string, unknown>;
6648
6735
  name?: string;
6649
6736
  }
@@ -6654,6 +6741,11 @@ interface WorkflowDefinition {
6654
6741
  name?: string;
6655
6742
  description?: string;
6656
6743
  isActive?: boolean;
6744
+ /**
6745
+ * Catalogue trigger. Omit for Manually Run with no input fields.
6746
+ * `runs.start` ignores this and runs the steps only.
6747
+ */
6748
+ trigger?: TriggerDefinition;
6657
6749
  /** Linear steps (v1; no branches). */
6658
6750
  steps: WorkflowStepDefinition[];
6659
6751
  }
@@ -6681,6 +6773,18 @@ interface AgentDefinition {
6681
6773
  declare function defineConnection(config?: Omit<ConnectionDefinition, 'kind'>): ConnectionDefinition;
6682
6774
  declare function defineAiConnection(config?: Omit<AiConnectionDefinition, 'kind'>): AiConnectionDefinition;
6683
6775
  declare function defineAction(config: Omit<ActionDefinition, 'kind'>): ActionDefinition;
6776
+ declare function defineTrigger(config: Omit<TriggerDefinition, 'kind'>): TriggerDefinition;
6777
+ /**
6778
+ * References for step inputs. The server swaps them for the real node ids on
6779
+ * deploy, and the builder shows them as mapped fields from earlier nodes.
6780
+ * They are plain strings, so they also work inside text and nested objects.
6781
+ */
6782
+ declare const ref: {
6783
+ /** A trigger output field, e.g. a Manually Run input id. */
6784
+ trigger: (field: string, ...path: Array<string | number>) => string;
6785
+ /** An earlier step's output, by its `key`. Array indexes are numbers. */
6786
+ step: (key: string, ...path: Array<string | number>) => string;
6787
+ };
6684
6788
  declare function defineWorkflow(config: Omit<WorkflowDefinition, 'kind'>): WorkflowDefinition;
6685
6789
  declare function defineAgent(config: Omit<AgentDefinition, 'kind'>): AgentDefinition;
6686
6790
  interface EntityTypeDefinition {
@@ -6705,6 +6809,9 @@ interface EntityTypeDefinition {
6705
6809
  declare function defineEntityType(config: Omit<EntityTypeDefinition, 'kind'>): EntityTypeDefinition;
6706
6810
  /** Infer appId from catalogue action ids like `http_action_send-request`. */
6707
6811
  declare function resolveActionAppId(action: ActionDefinition): string;
6812
+ /** Infer appId from catalogue trigger ids like `flow-control_trigger_manual`. */
6813
+ declare function resolveTriggerAppId(trigger: TriggerDefinition): string;
6814
+ declare function resolveTriggerId(trigger: TriggerDefinition): string;
6708
6815
  declare function resolveActionId(action: ActionDefinition): string;
6709
6816
 
6710
6817
  interface UpsertAgentToolInput {
@@ -7276,6 +7383,8 @@ declare class QueuesResource {
7276
7383
  }
7277
7384
 
7278
7385
  interface StartRunStep {
7386
+ /** Name later steps use with `ref.step(key, ...)`. */
7387
+ key?: string;
7279
7388
  appId: string;
7280
7389
  actionId: string;
7281
7390
  connectionId?: string;
@@ -7428,6 +7537,8 @@ declare class VariablesResource {
7428
7537
  }
7429
7538
 
7430
7539
  interface UpsertWorkflowStepInput {
7540
+ /** Name later steps use in `={{step:<key>,path}}`. Keeps the node id stable. */
7541
+ key?: string;
7431
7542
  appId: string;
7432
7543
  actionId: string;
7433
7544
  connectionId?: string;
@@ -7435,11 +7546,24 @@ interface UpsertWorkflowStepInput {
7435
7546
  name?: string;
7436
7547
  description?: string;
7437
7548
  }
7549
+ interface UpsertWorkflowTriggerInput {
7550
+ triggerId: string;
7551
+ appId?: string;
7552
+ connectionId?: string;
7553
+ /** Catalogue trigger config. */
7554
+ input?: Record<string, unknown>;
7555
+ /** Manual-trigger fields. Stored as `customInputConfig`. */
7556
+ inputs?: TriggerDefinition['inputs'];
7557
+ name?: string;
7558
+ description?: string;
7559
+ }
7438
7560
  interface UpsertWorkflowBySlugInput {
7439
7561
  slug: string;
7440
7562
  name?: string;
7441
7563
  description?: string;
7442
7564
  isActive?: boolean;
7565
+ /** Omit for Manually Run with no input fields. */
7566
+ trigger?: UpsertWorkflowTriggerInput;
7443
7567
  steps: UpsertWorkflowStepInput[];
7444
7568
  managedByCode?: boolean;
7445
7569
  }
@@ -7668,4 +7792,4 @@ interface CreateServerClientOptions {
7668
7792
  */
7669
7793
  declare function createServerClient(options: CreateServerClientOptions): LunnoaClient;
7670
7794
 
7671
- export { API_KEY_PREFIX, type ActionDefinition, ActionsResource, type AddQueueItemErrorInput, type Agent, AgentChatClient, AgentChatStream, type AgentDefinition, type AgentToolDefinition, AgentsResource, type AiConnection, type AiConnectionDefinition, type AiConnectionModel, AiConnectionsResource, type ApprovalInboxItem, ApprovalsResource, AuthResource, type AuthTokens, type BulkCreateQueueItemsInput, type BulkCreateQueueItemsResult, type ChangeEntityStateInput, type ChangeEntityStateResult, type ChatMode, type Connection, type ConnectionDefinition, ConnectionsResource, type CreateBrowserClientOptions, type CreateEntityInput, type CreateKnowledgeInput, type CreateQueueInput, type CreateQueueItemInput, type CreateServerClientOptions, type CreateTaskInput, type CreateVariableInput, type CurrentUser, DEFINE_KINDS, type DefineKind, type DeletedTask, DiscoveryResource, type EligibleApprover, type EnabledFeatures, EntitiesResource, type Entity, type EntityStateHistoryEntry, type EntityStateTransitions, type EntityType, type EntityTypeDefinition, type EntityTypeReadOptions, EntityTypesResource, type ExecuteWorkflowResult, type Execution, type ExecutionPathStep, type ExecutionProgress, type ExecutionProgressPayload, type ExecutionProgressStep, ExecutionProgressStream, type ExecutionStatus, type ExecutionStreamEvent, type ExecutionStreamEventType, ExecutionTimeoutError, ExecutionsResource, type ExportEntitiesInput, type FetchLike, HttpClient, type ImportEntitiesInput, type ImportEntitiesResult, type ImportTemplate, type Knowledge, type KnowledgeDocument, type KnowledgeDocumentGroup, KnowledgeResource, type ListEntitiesOptions, type ListQueryOptions, type ListQueueItemsByObjectOptions, type ListQueueItemsOptions, type LocalStorageTokenStoreOptions, type LoginRequires2FA, type LoginResult, type LoginSuccess, LunnoaApiError, LunnoaClient, type LunnoaClientOptions, type MessageTaskInput, type OffsetPagination, type PagePagination, type PaginatedEntities, type PendingInput, type PendingInputField, type QueryValue, type Queue, type QueueAllowedObjectType, type QueueItem, type QueueItemCreated, type QueueItemErrorEntry, type QueueItemFull, type QueueItemList, type QueueItemObjectSummary, type QueueItemStats, type QueueItemStatus, QueueItemsResource, type QueueStats, QueuesResource, type RecordMeasureValueInput, type RequestOptions, type RunActionInput, type RunActionOptions, type RunActionResult, RunsResource, type SaveUploadedTextInput, type Scorecard, type ScorecardMeasure, type ScorecardMeasureStatus, type ScorecardMeasureValue, type ScorecardObjective, type ScorecardSummary, ScorecardsResource, type SseEvent, SsoAuthResource, type SsoProviderSummary, type SsoProvidersResponse, type StartRunInput, type StartRunInputDto, type StartRunOptions, type StartRunStep, type StopStreamOptions, type StreamMessageOptions, type Table, TablesResource, type Task, type TaskListItem, TasksResource, type TokenStore, type UpdateEntityInput, type UpdateKnowledgeInput, type UpdateQueueInput, type UpdateQueueItemInput, type UpdateTaskInput, type UpdateVariableInput, type UpsertAgentBySlugInput, type UpsertAgentBySlugInputDto, type UpsertAgentToolInput, type UpsertEntityTypeBySlugInput, type UpsertTableBySlugInput, type UpsertWorkflowBySlugInput, type UpsertWorkflowBySlugInputDto, type UpsertWorkflowStepInput, type Variable, VariablesResource, type WaitUntilFinishedOptions, type WatchProgressOptions, type Workflow, type WorkflowApp, WorkflowAppsResource, type WorkflowDefinition, type WorkflowStepDefinition, WorkflowsResource, assertApiKeyAllowedInEnvironment, type components, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, type operations, parseSseEvents, parseSseStream, type paths, resolveActionAppId, resolveActionId };
7795
+ export { API_KEY_PREFIX, type ActionDefinition, ActionsResource, type AddQueueItemErrorInput, type Agent, AgentChatClient, AgentChatStream, type AgentDefinition, type AgentToolDefinition, AgentsResource, type AiConnection, type AiConnectionDefinition, type AiConnectionModel, AiConnectionsResource, type ApprovalInboxItem, ApprovalsResource, AuthResource, type AuthTokens, type BulkCreateQueueItemsInput, type BulkCreateQueueItemsResult, type ChangeEntityStateInput, type ChangeEntityStateResult, type ChatMode, type Connection, type ConnectionDefinition, ConnectionsResource, type CreateBrowserClientOptions, type CreateEntityInput, type CreateKnowledgeInput, type CreateQueueInput, type CreateQueueItemInput, type CreateServerClientOptions, type CreateTaskInput, type CreateVariableInput, type CurrentUser, DEFINE_KINDS, type DefineKind, type DeletedTask, DiscoveryResource, type EligibleApprover, type EnabledFeatures, EntitiesResource, type Entity, type EntityStateHistoryEntry, type EntityStateTransitions, type EntityType, type EntityTypeDefinition, type EntityTypeReadOptions, EntityTypesResource, type ExecuteWorkflowResult, type Execution, type ExecutionPathStep, type ExecutionProgress, type ExecutionProgressPayload, type ExecutionProgressStep, ExecutionProgressStream, type ExecutionStatus, type ExecutionStreamEvent, type ExecutionStreamEventType, ExecutionTimeoutError, ExecutionsResource, type ExportEntitiesInput, type FetchLike, HttpClient, type ImportEntitiesInput, type ImportEntitiesResult, type ImportTemplate, type Knowledge, type KnowledgeDocument, type KnowledgeDocumentGroup, KnowledgeResource, type ListEntitiesOptions, type ListQueryOptions, type ListQueueItemsByObjectOptions, type ListQueueItemsOptions, type LocalStorageTokenStoreOptions, type LoginRequires2FA, type LoginResult, type LoginSuccess, LunnoaApiError, LunnoaClient, type LunnoaClientOptions, type MessageTaskInput, type OffsetPagination, type PagePagination, type PaginatedEntities, type PendingInput, type PendingInputField, type QueryValue, type Queue, type QueueAllowedObjectType, type QueueItem, type QueueItemCreated, type QueueItemErrorEntry, type QueueItemFull, type QueueItemList, type QueueItemObjectSummary, type QueueItemStats, type QueueItemStatus, QueueItemsResource, type QueueStats, QueuesResource, type RecordMeasureValueInput, type RequestOptions, type RunActionInput, type RunActionOptions, type RunActionResult, RunsResource, type SaveUploadedTextInput, type Scorecard, type ScorecardMeasure, type ScorecardMeasureStatus, type ScorecardMeasureValue, type ScorecardObjective, type ScorecardSummary, ScorecardsResource, type SseEvent, SsoAuthResource, type SsoProviderSummary, type SsoProvidersResponse, type StartRunInput, type StartRunInputDto, type StartRunOptions, type StartRunStep, type StopStreamOptions, type StreamMessageOptions, type Table, TablesResource, type Task, type TaskListItem, TasksResource, type TokenStore, type TriggerDefinition, type TriggerInputFieldDefinition, type UpdateEntityInput, type UpdateKnowledgeInput, type UpdateQueueInput, type UpdateQueueItemInput, type UpdateTaskInput, type UpdateVariableInput, type UpsertAgentBySlugInput, type UpsertAgentBySlugInputDto, type UpsertAgentToolInput, type UpsertEntityTypeBySlugInput, type UpsertTableBySlugInput, type UpsertWorkflowBySlugInput, type UpsertWorkflowBySlugInputDto, type UpsertWorkflowStepInput, type UpsertWorkflowTriggerInput, type Variable, VariablesResource, type WaitUntilFinishedOptions, type WatchProgressOptions, type Workflow, type WorkflowApp, WorkflowAppsResource, type WorkflowDefinition, type WorkflowStepDefinition, WorkflowsResource, assertApiKeyAllowedInEnvironment, type components, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineTrigger, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, type operations, parseSseEvents, parseSseStream, type paths, ref, resolveActionAppId, resolveActionId, resolveTriggerAppId, resolveTriggerId };
package/dist/index.d.ts CHANGED
@@ -715,7 +715,7 @@ interface paths {
715
715
  put?: never;
716
716
  /**
717
717
  * Upsert a workflow by slug from a linear step list
718
- * @description Creates or updates a workflow identified by workspace-scoped `slug`. Builds a minimal valid graph (manual trigger → linear catalogue-action steps). Marks `managedByCode` by default. Prefer the CLI (`npx @lunnoa/client workflows deploy`) over calling this from application code.
718
+ * @description Creates or updates a workflow identified by workspace-scoped `slug`. Builds a minimal valid graph (one catalogue trigger, Manually Run when omitted, then linear catalogue-action steps). Marks `managedByCode` by default. Prefer the CLI (`npx @lunnoa/client workflows deploy`) over calling this from application code.
719
719
  */
720
720
  post: operations["WorkflowsController_upsertBySlug"];
721
721
  delete?: never;
@@ -2299,13 +2299,18 @@ interface components {
2299
2299
  requestedCount: number;
2300
2300
  };
2301
2301
  UpsertWorkflowStepDto: {
2302
+ /**
2303
+ * @description Name later steps use in ={{step:<key>,path}}. Keyed steps keep their node id across deploys. "trigger" is reserved.
2304
+ * @example loadCase
2305
+ */
2306
+ key?: string;
2302
2307
  /** @description Workflow app id (catalogue slug). */
2303
2308
  appId: string;
2304
2309
  /** @description Catalogue action id. */
2305
2310
  actionId: string;
2306
2311
  /** @description Connection instance UUID for this step. */
2307
2312
  connectionId?: string;
2308
- /** @description Action input / config fields. */
2313
+ /** @description Action input / config fields. String values may use ={{step:trigger,field}} or ={{step:<key>,path,to,value}}. */
2309
2314
  input?: {
2310
2315
  [key: string]: unknown;
2311
2316
  };
@@ -2314,6 +2319,41 @@ interface components {
2314
2319
  /** @description Step description. */
2315
2320
  description?: string;
2316
2321
  };
2322
+ UpsertWorkflowTriggerInputFieldDto: {
2323
+ /** @description Field id. Callers pass this key to workflows.execute. */
2324
+ id: string;
2325
+ /** @description Label shown on the Manually Run form. */
2326
+ label?: string;
2327
+ description?: string;
2328
+ /** @description text, number, date, or select. Defaults to text. */
2329
+ inputType?: string;
2330
+ /** @description true, or { missingMessage, missingStatus }. */
2331
+ required?: boolean | {
2332
+ [key: string]: unknown;
2333
+ };
2334
+ /** @description Used when the caller omits the field. */
2335
+ defaultValue?: unknown;
2336
+ selectOptions?: {
2337
+ [key: string]: unknown;
2338
+ }[];
2339
+ };
2340
+ UpsertWorkflowTriggerDto: {
2341
+ /** @description Catalogue trigger id, for example flow-control_trigger_manual. */
2342
+ triggerId: string;
2343
+ /** @description Workflow app id. Inferred from triggerId when it contains _trigger_. */
2344
+ appId?: string;
2345
+ /** @description Connection instance UUID for this trigger. */
2346
+ connectionId?: string;
2347
+ /** @description Trigger config fields from the catalogue inputConfig. */
2348
+ input?: {
2349
+ [key: string]: unknown;
2350
+ };
2351
+ /** @description Manual-trigger fields. Stored on the trigger as customInputConfig. */
2352
+ inputs?: components["schemas"]["UpsertWorkflowTriggerInputFieldDto"][];
2353
+ /** @description Display name for the trigger node. */
2354
+ name?: string;
2355
+ description?: string;
2356
+ };
2317
2357
  UpsertWorkflowBySlugDto: {
2318
2358
  /**
2319
2359
  * @description Stable workspace-scoped slug (lowercase, digits, hyphens). Used as the upsert key.
@@ -2325,6 +2365,8 @@ interface components {
2325
2365
  description?: string;
2326
2366
  /** @description Whether the workflow is active. */
2327
2367
  isActive?: boolean;
2368
+ /** @description Catalogue trigger. Omit for a Manually Run trigger with no input fields. */
2369
+ trigger?: components["schemas"]["UpsertWorkflowTriggerDto"];
2328
2370
  /** @description Linear catalogue-action steps (v1; no branches). */
2329
2371
  steps: components["schemas"]["UpsertWorkflowStepDto"][];
2330
2372
  /** @description Marks the row as managed by code (CLI / SDK). Defaults to true on this endpoint. */
@@ -3427,6 +3469,8 @@ interface components {
3427
3469
  executionPath?: components["schemas"]["ExecutionPathStepDto"][];
3428
3470
  };
3429
3471
  RunStepDto: {
3472
+ /** @description Name later steps use in ={{step:<key>,path}}. Ad-hoc runs have no trigger. */
3473
+ key?: string;
3430
3474
  /** @description Workflow app id (catalogue slug), e.g. `http`, `gmail`. */
3431
3475
  appId: string;
3432
3476
  /** @description Action id within the app, e.g. `http_action_send-request`. Discover via GET /workflow-apps. */
@@ -6605,6 +6649,7 @@ declare const DEFINE_KINDS: {
6605
6649
  readonly connection: "connection";
6606
6650
  readonly aiConnection: "aiConnection";
6607
6651
  readonly action: "action";
6652
+ readonly trigger: "trigger";
6608
6653
  readonly workflow: "workflow";
6609
6654
  readonly agent: "agent";
6610
6655
  readonly entityType: "entityType";
@@ -6640,10 +6685,52 @@ interface ActionDefinition {
6640
6685
  name?: string;
6641
6686
  description?: string;
6642
6687
  }
6688
+ /** One field on a Manually Run trigger. Stored as `customInputConfig`. */
6689
+ interface TriggerInputFieldDefinition {
6690
+ /** Field id. Callers pass this key to `workflows.execute`. */
6691
+ id: string;
6692
+ label?: string;
6693
+ description?: string;
6694
+ /** `text`, `number`, `date`, or `select`. Defaults to `text` on deploy. */
6695
+ inputType?: string;
6696
+ required?: boolean | {
6697
+ missingMessage?: string;
6698
+ missingStatus?: string;
6699
+ };
6700
+ defaultValue?: unknown;
6701
+ selectOptions?: Array<{
6702
+ label?: string;
6703
+ value?: string;
6704
+ }>;
6705
+ }
6706
+ /** Ref to a catalogue trigger. Credentials stay on the connection, when one is set. */
6707
+ interface TriggerDefinition {
6708
+ kind: typeof DEFINE_KINDS.trigger;
6709
+ /**
6710
+ * Catalogue trigger id, e.g. `flow-control_trigger_manual`.
6711
+ * Discover with `apps get <appId> --json` (`triggers[].triggerId`).
6712
+ */
6713
+ id: string;
6714
+ /** Workflow app id. Inferred from `id` when it matches `{app}_trigger_…`. */
6715
+ appId?: string;
6716
+ /** Optional Connection ref. Omit to let the platform resolve. */
6717
+ connection?: ConnectionDefinition;
6718
+ /** Catalogue trigger config (webhook method, schedule, app trigger fields). */
6719
+ input?: Record<string, unknown>;
6720
+ /** Manual-trigger fields. Stored as `customInputConfig`. */
6721
+ inputs?: TriggerInputFieldDefinition[];
6722
+ name?: string;
6723
+ description?: string;
6724
+ }
6643
6725
  interface WorkflowStepDefinition {
6726
+ /**
6727
+ * Name later steps use with `ref.step(key, ...)`. Keyed steps keep their
6728
+ * node id across deploys. `trigger` is reserved.
6729
+ */
6730
+ key?: string;
6644
6731
  /** Action definition (or inline action-shaped object). */
6645
6732
  use: ActionDefinition;
6646
- /** Per-step input overrides. */
6733
+ /** Per-step input overrides. Values may contain `ref.trigger` / `ref.step`. */
6647
6734
  input?: Record<string, unknown>;
6648
6735
  name?: string;
6649
6736
  }
@@ -6654,6 +6741,11 @@ interface WorkflowDefinition {
6654
6741
  name?: string;
6655
6742
  description?: string;
6656
6743
  isActive?: boolean;
6744
+ /**
6745
+ * Catalogue trigger. Omit for Manually Run with no input fields.
6746
+ * `runs.start` ignores this and runs the steps only.
6747
+ */
6748
+ trigger?: TriggerDefinition;
6657
6749
  /** Linear steps (v1; no branches). */
6658
6750
  steps: WorkflowStepDefinition[];
6659
6751
  }
@@ -6681,6 +6773,18 @@ interface AgentDefinition {
6681
6773
  declare function defineConnection(config?: Omit<ConnectionDefinition, 'kind'>): ConnectionDefinition;
6682
6774
  declare function defineAiConnection(config?: Omit<AiConnectionDefinition, 'kind'>): AiConnectionDefinition;
6683
6775
  declare function defineAction(config: Omit<ActionDefinition, 'kind'>): ActionDefinition;
6776
+ declare function defineTrigger(config: Omit<TriggerDefinition, 'kind'>): TriggerDefinition;
6777
+ /**
6778
+ * References for step inputs. The server swaps them for the real node ids on
6779
+ * deploy, and the builder shows them as mapped fields from earlier nodes.
6780
+ * They are plain strings, so they also work inside text and nested objects.
6781
+ */
6782
+ declare const ref: {
6783
+ /** A trigger output field, e.g. a Manually Run input id. */
6784
+ trigger: (field: string, ...path: Array<string | number>) => string;
6785
+ /** An earlier step's output, by its `key`. Array indexes are numbers. */
6786
+ step: (key: string, ...path: Array<string | number>) => string;
6787
+ };
6684
6788
  declare function defineWorkflow(config: Omit<WorkflowDefinition, 'kind'>): WorkflowDefinition;
6685
6789
  declare function defineAgent(config: Omit<AgentDefinition, 'kind'>): AgentDefinition;
6686
6790
  interface EntityTypeDefinition {
@@ -6705,6 +6809,9 @@ interface EntityTypeDefinition {
6705
6809
  declare function defineEntityType(config: Omit<EntityTypeDefinition, 'kind'>): EntityTypeDefinition;
6706
6810
  /** Infer appId from catalogue action ids like `http_action_send-request`. */
6707
6811
  declare function resolveActionAppId(action: ActionDefinition): string;
6812
+ /** Infer appId from catalogue trigger ids like `flow-control_trigger_manual`. */
6813
+ declare function resolveTriggerAppId(trigger: TriggerDefinition): string;
6814
+ declare function resolveTriggerId(trigger: TriggerDefinition): string;
6708
6815
  declare function resolveActionId(action: ActionDefinition): string;
6709
6816
 
6710
6817
  interface UpsertAgentToolInput {
@@ -7276,6 +7383,8 @@ declare class QueuesResource {
7276
7383
  }
7277
7384
 
7278
7385
  interface StartRunStep {
7386
+ /** Name later steps use with `ref.step(key, ...)`. */
7387
+ key?: string;
7279
7388
  appId: string;
7280
7389
  actionId: string;
7281
7390
  connectionId?: string;
@@ -7428,6 +7537,8 @@ declare class VariablesResource {
7428
7537
  }
7429
7538
 
7430
7539
  interface UpsertWorkflowStepInput {
7540
+ /** Name later steps use in `={{step:<key>,path}}`. Keeps the node id stable. */
7541
+ key?: string;
7431
7542
  appId: string;
7432
7543
  actionId: string;
7433
7544
  connectionId?: string;
@@ -7435,11 +7546,24 @@ interface UpsertWorkflowStepInput {
7435
7546
  name?: string;
7436
7547
  description?: string;
7437
7548
  }
7549
+ interface UpsertWorkflowTriggerInput {
7550
+ triggerId: string;
7551
+ appId?: string;
7552
+ connectionId?: string;
7553
+ /** Catalogue trigger config. */
7554
+ input?: Record<string, unknown>;
7555
+ /** Manual-trigger fields. Stored as `customInputConfig`. */
7556
+ inputs?: TriggerDefinition['inputs'];
7557
+ name?: string;
7558
+ description?: string;
7559
+ }
7438
7560
  interface UpsertWorkflowBySlugInput {
7439
7561
  slug: string;
7440
7562
  name?: string;
7441
7563
  description?: string;
7442
7564
  isActive?: boolean;
7565
+ /** Omit for Manually Run with no input fields. */
7566
+ trigger?: UpsertWorkflowTriggerInput;
7443
7567
  steps: UpsertWorkflowStepInput[];
7444
7568
  managedByCode?: boolean;
7445
7569
  }
@@ -7668,4 +7792,4 @@ interface CreateServerClientOptions {
7668
7792
  */
7669
7793
  declare function createServerClient(options: CreateServerClientOptions): LunnoaClient;
7670
7794
 
7671
- export { API_KEY_PREFIX, type ActionDefinition, ActionsResource, type AddQueueItemErrorInput, type Agent, AgentChatClient, AgentChatStream, type AgentDefinition, type AgentToolDefinition, AgentsResource, type AiConnection, type AiConnectionDefinition, type AiConnectionModel, AiConnectionsResource, type ApprovalInboxItem, ApprovalsResource, AuthResource, type AuthTokens, type BulkCreateQueueItemsInput, type BulkCreateQueueItemsResult, type ChangeEntityStateInput, type ChangeEntityStateResult, type ChatMode, type Connection, type ConnectionDefinition, ConnectionsResource, type CreateBrowserClientOptions, type CreateEntityInput, type CreateKnowledgeInput, type CreateQueueInput, type CreateQueueItemInput, type CreateServerClientOptions, type CreateTaskInput, type CreateVariableInput, type CurrentUser, DEFINE_KINDS, type DefineKind, type DeletedTask, DiscoveryResource, type EligibleApprover, type EnabledFeatures, EntitiesResource, type Entity, type EntityStateHistoryEntry, type EntityStateTransitions, type EntityType, type EntityTypeDefinition, type EntityTypeReadOptions, EntityTypesResource, type ExecuteWorkflowResult, type Execution, type ExecutionPathStep, type ExecutionProgress, type ExecutionProgressPayload, type ExecutionProgressStep, ExecutionProgressStream, type ExecutionStatus, type ExecutionStreamEvent, type ExecutionStreamEventType, ExecutionTimeoutError, ExecutionsResource, type ExportEntitiesInput, type FetchLike, HttpClient, type ImportEntitiesInput, type ImportEntitiesResult, type ImportTemplate, type Knowledge, type KnowledgeDocument, type KnowledgeDocumentGroup, KnowledgeResource, type ListEntitiesOptions, type ListQueryOptions, type ListQueueItemsByObjectOptions, type ListQueueItemsOptions, type LocalStorageTokenStoreOptions, type LoginRequires2FA, type LoginResult, type LoginSuccess, LunnoaApiError, LunnoaClient, type LunnoaClientOptions, type MessageTaskInput, type OffsetPagination, type PagePagination, type PaginatedEntities, type PendingInput, type PendingInputField, type QueryValue, type Queue, type QueueAllowedObjectType, type QueueItem, type QueueItemCreated, type QueueItemErrorEntry, type QueueItemFull, type QueueItemList, type QueueItemObjectSummary, type QueueItemStats, type QueueItemStatus, QueueItemsResource, type QueueStats, QueuesResource, type RecordMeasureValueInput, type RequestOptions, type RunActionInput, type RunActionOptions, type RunActionResult, RunsResource, type SaveUploadedTextInput, type Scorecard, type ScorecardMeasure, type ScorecardMeasureStatus, type ScorecardMeasureValue, type ScorecardObjective, type ScorecardSummary, ScorecardsResource, type SseEvent, SsoAuthResource, type SsoProviderSummary, type SsoProvidersResponse, type StartRunInput, type StartRunInputDto, type StartRunOptions, type StartRunStep, type StopStreamOptions, type StreamMessageOptions, type Table, TablesResource, type Task, type TaskListItem, TasksResource, type TokenStore, type UpdateEntityInput, type UpdateKnowledgeInput, type UpdateQueueInput, type UpdateQueueItemInput, type UpdateTaskInput, type UpdateVariableInput, type UpsertAgentBySlugInput, type UpsertAgentBySlugInputDto, type UpsertAgentToolInput, type UpsertEntityTypeBySlugInput, type UpsertTableBySlugInput, type UpsertWorkflowBySlugInput, type UpsertWorkflowBySlugInputDto, type UpsertWorkflowStepInput, type Variable, VariablesResource, type WaitUntilFinishedOptions, type WatchProgressOptions, type Workflow, type WorkflowApp, WorkflowAppsResource, type WorkflowDefinition, type WorkflowStepDefinition, WorkflowsResource, assertApiKeyAllowedInEnvironment, type components, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, type operations, parseSseEvents, parseSseStream, type paths, resolveActionAppId, resolveActionId };
7795
+ export { API_KEY_PREFIX, type ActionDefinition, ActionsResource, type AddQueueItemErrorInput, type Agent, AgentChatClient, AgentChatStream, type AgentDefinition, type AgentToolDefinition, AgentsResource, type AiConnection, type AiConnectionDefinition, type AiConnectionModel, AiConnectionsResource, type ApprovalInboxItem, ApprovalsResource, AuthResource, type AuthTokens, type BulkCreateQueueItemsInput, type BulkCreateQueueItemsResult, type ChangeEntityStateInput, type ChangeEntityStateResult, type ChatMode, type Connection, type ConnectionDefinition, ConnectionsResource, type CreateBrowserClientOptions, type CreateEntityInput, type CreateKnowledgeInput, type CreateQueueInput, type CreateQueueItemInput, type CreateServerClientOptions, type CreateTaskInput, type CreateVariableInput, type CurrentUser, DEFINE_KINDS, type DefineKind, type DeletedTask, DiscoveryResource, type EligibleApprover, type EnabledFeatures, EntitiesResource, type Entity, type EntityStateHistoryEntry, type EntityStateTransitions, type EntityType, type EntityTypeDefinition, type EntityTypeReadOptions, EntityTypesResource, type ExecuteWorkflowResult, type Execution, type ExecutionPathStep, type ExecutionProgress, type ExecutionProgressPayload, type ExecutionProgressStep, ExecutionProgressStream, type ExecutionStatus, type ExecutionStreamEvent, type ExecutionStreamEventType, ExecutionTimeoutError, ExecutionsResource, type ExportEntitiesInput, type FetchLike, HttpClient, type ImportEntitiesInput, type ImportEntitiesResult, type ImportTemplate, type Knowledge, type KnowledgeDocument, type KnowledgeDocumentGroup, KnowledgeResource, type ListEntitiesOptions, type ListQueryOptions, type ListQueueItemsByObjectOptions, type ListQueueItemsOptions, type LocalStorageTokenStoreOptions, type LoginRequires2FA, type LoginResult, type LoginSuccess, LunnoaApiError, LunnoaClient, type LunnoaClientOptions, type MessageTaskInput, type OffsetPagination, type PagePagination, type PaginatedEntities, type PendingInput, type PendingInputField, type QueryValue, type Queue, type QueueAllowedObjectType, type QueueItem, type QueueItemCreated, type QueueItemErrorEntry, type QueueItemFull, type QueueItemList, type QueueItemObjectSummary, type QueueItemStats, type QueueItemStatus, QueueItemsResource, type QueueStats, QueuesResource, type RecordMeasureValueInput, type RequestOptions, type RunActionInput, type RunActionOptions, type RunActionResult, RunsResource, type SaveUploadedTextInput, type Scorecard, type ScorecardMeasure, type ScorecardMeasureStatus, type ScorecardMeasureValue, type ScorecardObjective, type ScorecardSummary, ScorecardsResource, type SseEvent, SsoAuthResource, type SsoProviderSummary, type SsoProvidersResponse, type StartRunInput, type StartRunInputDto, type StartRunOptions, type StartRunStep, type StopStreamOptions, type StreamMessageOptions, type Table, TablesResource, type Task, type TaskListItem, TasksResource, type TokenStore, type TriggerDefinition, type TriggerInputFieldDefinition, type UpdateEntityInput, type UpdateKnowledgeInput, type UpdateQueueInput, type UpdateQueueItemInput, type UpdateTaskInput, type UpdateVariableInput, type UpsertAgentBySlugInput, type UpsertAgentBySlugInputDto, type UpsertAgentToolInput, type UpsertEntityTypeBySlugInput, type UpsertTableBySlugInput, type UpsertWorkflowBySlugInput, type UpsertWorkflowBySlugInputDto, type UpsertWorkflowStepInput, type UpsertWorkflowTriggerInput, type Variable, VariablesResource, type WaitUntilFinishedOptions, type WatchProgressOptions, type Workflow, type WorkflowApp, WorkflowAppsResource, type WorkflowDefinition, type WorkflowStepDefinition, WorkflowsResource, assertApiKeyAllowedInEnvironment, type components, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineTrigger, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, type operations, parseSseEvents, parseSseStream, type paths, ref, resolveActionAppId, resolveActionId, resolveTriggerAppId, resolveTriggerId };