(
userId: string,
workflowId: string,
chatId?: string,
options?: {
workspaceId?: string
decryptedEnvVars?: Record<string, string>
}
)
| 3 | import { getWorkflowById } from '@/lib/workflows/utils' |
| 4 | |
| 5 | export async function prepareExecutionContext( |
| 6 | userId: string, |
| 7 | workflowId: string, |
| 8 | chatId?: string, |
| 9 | options?: { |
| 10 | workspaceId?: string |
| 11 | decryptedEnvVars?: Record<string, string> |
| 12 | } |
| 13 | ): Promise<ExecutionContext> { |
| 14 | const workspaceId = |
| 15 | options?.workspaceId ?? (await getWorkflowById(workflowId))?.workspaceId ?? undefined |
| 16 | const decryptedEnvVars = |
| 17 | options?.decryptedEnvVars ?? (await getEffectiveDecryptedEnv(userId, workspaceId)) |
| 18 | |
| 19 | return { |
| 20 | userId, |
| 21 | workflowId, |
| 22 | workspaceId, |
| 23 | chatId, |
| 24 | decryptedEnvVars, |
| 25 | } |
| 26 | } |
no test coverage detected