Skip to content

feat: implement lookup step handling in orchestrated operations#90

Open
jlouvel wants to merge 1 commit intomainfrom
feat/look-up-steps
Open

feat: implement lookup step handling in orchestrated operations#90
jlouvel wants to merge 1 commit intomainfrom
feat/look-up-steps

Conversation

@jlouvel
Copy link
Contributor

@jlouvel jlouvel commented Mar 4, 2026

Add support for cross-referencing data across steps in orchestrated API operations through lookup steps. This enables complex multi-step workflows where later steps can reference and extract specific fields from earlier step outputs.

Changes:

  • Add StepExecutionContext to maintain step outputs during orchestrated execution
  • Enhance call step processing to capture and store JSON responses for later reference
  • Implement OperationStepLookupSpec handling in ApiResourceRestlet
    • Retrieve index data from previous call steps
    • Resolve lookup values using template expressions
    • Execute lookup operations to find and extract matching entries
    • Store results for subsequent steps

This implementation enables:

  • Cross-referencing between orchestrated steps
  • Field-level extraction from step outputs
  • Greater flexibility in complex API orchestration scenarios

@jlouvel jlouvel requested a review from eskenazit March 4, 2026 01:11
@jlouvel jlouvel self-assigned this Mar 4, 2026
Add support for cross-referencing data across steps in orchestrated API operations through lookup steps. This enables complex multi-step workflows where later steps can reference and extract specific fields from earlier step outputs.

Changes:
- Add StepExecutionContext to maintain step outputs during orchestrated execution
- Enhance call step processing to capture and store JSON responses for later reference
- Implement OperationStepLookupSpec handling in ApiResourceRestlet
  - Retrieve index data from previous call steps
  - Resolve lookup values using template expressions
  - Execute lookup operations to find and extract matching entries
  - Store results for subsequent steps

This implementation enables:
- Cross-referencing between orchestrated steps
- Field-level extraction from step outputs
- Greater flexibility in complex API orchestration scenarios
@eskenazit eskenazit force-pushed the feat/look-up-steps branch from be981e5 to dfe2698 Compare March 4, 2026 09:55
Copy link
Contributor

@eskenazit eskenazit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel an integration test with a simple complete yml chaining fetch then lookup is missing.

ObjectMapper mapper = new ObjectMapper();

for (OperationStepSpec step : serverOp.getSteps()) {
if (step instanceof OperationStepCallSpec) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given we might end with other steps, shouldn't we use a switch (step) case with pattern matching here for having a more readable code ?

stepParams.putAll(step.getCall().getWith());
}
for (OperationStepSpec step : toolSpec.getSteps()) {
if (step instanceof OperationStepCallSpec) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given we might end with other steps, shouldn't we use a switch (step) case with pattern matching here for having a more readable code ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants