fix(child-workflow): hosted api key resolution#2687
Merged
icecrasher321 merged 1 commit intostagingfrom Jan 6, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryFixed hosted API key resolution for child workflow executions by passing Key changes:
This ensures child workflows use the same API key resolution logic as parent workflows, supporting multi-tenancy and proper cost attribution. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Parent as Parent Workflow
participant WH as WorkflowBlockHandler
participant Executor as Child Executor
participant DAG as DAGExecutor
participant Agent as AgentBlockHandler
participant Provider as Provider System
participant BYOK as BYOK Resolver
Parent->>WH: execute(ctx, block, inputs)
Note over Parent,WH: ctx has workspaceId, userId, executionId
WH->>WH: loadChildWorkflow(workflowId)
WH->>Executor: new Executor({<br/>contextExtensions: {<br/> workspaceId: ctx.workspaceId,<br/> userId: ctx.userId,<br/> executionId: ctx.executionId<br/>}})
Note over WH,Executor: FIX: Now passing context fields
Executor->>DAG: create execution context
Note over DAG: Maps contextExtensions to<br/>ExecutionContext
DAG->>Agent: execute LLM block
Note over Agent: Child workflow executes<br/>agent/LLM blocks
Agent->>Provider: executeProviderRequest({<br/>workspaceId: ctx.workspaceId<br/>})
Note over Provider: workspaceId now available
Provider->>BYOK: getApiKeyWithBYOK(provider, model, workspaceId)
BYOK->>BYOK: Query database for<br/>workspace BYOK key
alt BYOK key found
BYOK-->>Provider: Return workspace API key
else No BYOK, hosted model
BYOK-->>Provider: Return rotating hosted key
end
Provider-->>Agent: Execute with resolved API key
Agent-->>DAG: Return block output
DAG-->>WH: Return execution result
WH-->>Parent: Return child workflow output
|
waleedlatif1
pushed a commit
that referenced
this pull request
Jan 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Need to pass in right context extensions in workflow handler.
Type of Change
Testing
Tested manually.
Checklist