Skip to content

Commit

Permalink
Allow extractor chaining (#96)
Browse files Browse the repository at this point in the history
* Allow extractor chaining
  • Loading branch information
liamg authored Sep 30, 2023
1 parent 52b0fbc commit 4fd20af
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions backend/workflow/node/node_extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewExtractor() *ExtractorNode {
NewConnector("strip", transmission.TypeBoolean, false, "Remove leading/trailing whitespace"),
},
Connectors{
NewConnector("output", transmission.TypeMap, true),
NewConnector("output", transmission.TypeRequest|transmission.TypeResponse|transmission.TypeMap, true),
},
map[string]transmission.Transmission{
"type": transmission.NewChoice("body", map[string]string{
Expand Down Expand Up @@ -136,10 +136,15 @@ func (n *ExtractorNode) Start(ctx context.Context, in <-chan Input, out chan<- O
}
vars[variable] = value

request, err := n.ReadInputRequest("response", input.Data)
if err != nil {
return err
}

n.tryOut(ctx, out, OutputInstance{
OutputName: "output",
Complete: input.Last,
Data: transmission.NewMap(vars),
Data: transmission.NewRequestResponsePairWithMap(*request, *response, vars),
})
}
}
Expand Down

0 comments on commit 4fd20af

Please sign in to comment.