Payload needed for invoking an agent inside a workflow?

Hi there,

We have been busy testing the new agent feature today and we're keen to get that inside a workflow.

Apologies in advance if we missed a section of documentation about this step, but what is the correct payload/format to invoke that new agent inside a workflow?

Adding the component, selecting the agent is fine, it's just that last step where we need to include a payload / object to sent an instruction remotely to that agent that blocks us.

Any advice on this step would be fantastic, thank you!
Jerome

Edit 1:

All our attempts so far resulted in:

|error|{payload.action:Invalid discriminator value. Expected 'invoke' | 'getLogs' | 'getLogsForAgent' | 'terminate' | 'submitToolApproval' | 'submitAuthApproval'}|
|---|---|
|errorCode|400|

Or

error {payload:Expected object, received string}
errorCode 400

Hi @Jeje,

Thanks for reaching out! Here's the input format for invoking an agent:

{
  "messages": [ 
    { 
      "role": "user", 
      "content": {{ startTrigger.data }}
    } 
  ], 
  "action": "invoke" 
}

Replace the content value with the text that you want to use to prompt the agent.

More info in docs. Let us know how it goes :slightly_smiling_face:

2 Likes

Oh briliant, thank you Tess, this works!

1 Like

Glad to hear! Thanks for the question. I chatted with the Agents team about this, and we'll most likely add a docs link directly in the Agent block so folks can find it more easily. We could probably add a form or GUI for this format in the future too

2 Likes