/** * Dynamic workflow run entrypoint * * Runs inside an ephemeral run execution container or process. * Dynamically discovers and loads workflow definitions from the user's project * using the Veryfront API backend. * * This is the recommended entrypoint for multi-tenant deployments where * user code is stored in the Veryfront API and not bundled into the container. * * Environment variables: * - WORKFLOW_RUN_ID: The workflow run to execute * - RUN_EXECUTION_ID: Immutable execution identity assigned by the run manager * - TENANT_PROJECT_SLUG: Tenant's project slug * - TENANT_TOKEN: Tenant's API token * - TENANT_PROJECT_ID: Tenant's project ID * - TENANT_PRODUCTION_MODE: Whether running in production mode * - TENANT_RELEASE_ID: Current release ID (optional) * - REDIS_URL: Redis connection URL * - VERYFRONT_API_URL: Veryfront API URL (default: https://api.veryfront.com) * * Exit codes: * - 0: Workflow completed successfully * - 1: Workflow failed * - 2: Configuration error * - 3: Workflow not found */ import type { WorkflowBackend } from "../backends/types.js"; /** * Exit codes for the dynamic workflow run entrypoint. */ export declare const DYNAMIC_EXIT_CODES: { readonly SUCCESS: 0; readonly WORKFLOW_FAILED: 1; readonly CONFIG_ERROR: 2; readonly NOT_FOUND: 3; readonly DISCOVERY_FAILED: 4; }; /** * Configuration for the dynamic workflow run entrypoint. */ export interface DynamicWorkflowRunEntrypointConfig { /** Backend for workflow persistence */ backend: WorkflowBackend; /** Enable debug logging */ debug?: boolean; } /** * Run a workflow run with dynamic discovery. * * This function: * 1. Gets the run from Redis * 2. Sets up tenant context * 3. Initializes FS adapter with Veryfront API backend * 4. Discovers workflows from user's project files * 5. Finds the matching workflow * 6. Executes the workflow */ export declare function runDynamicWorkflowRun(config: DynamicWorkflowRunEntrypointConfig): Promise; /** * Create a dynamic workflow run entrypoint. * * This is a convenience function that sets up Redis backend * and returns a function to run the workflow run. * * @example * ```typescript * // workflow-runner.ts * import { createDynamicWorkflowRunEntrypoint } from "veryfront/workflow/worker"; * import { getEnv } from "veryfront"; * * const run = await createDynamicWorkflowRunEntrypoint({ * redisUrl: getEnv("REDIS_URL")!, * }); * * const exitCode = await run(); * if (exitCode !== 0) throw new Error(`Workflow run failed: ${exitCode}`); * ``` */ export interface CreateDynamicWorkflowRunEntrypointOptions { /** Redis URL for backend */ redisUrl: string; /** Enable debug logging */ debug?: boolean; } /** Create a dynamic workflow run entrypoint. */ export declare function createDynamicWorkflowRunEntrypoint(options: CreateDynamicWorkflowRunEntrypointOptions): Promise<() => Promise>; //# sourceMappingURL=dynamic-run-entrypoint.d.ts.map