Invoke agent from workflow block : result type 'sync' returns behaves like 'async'

Hi guys,

I am a retool enthousiast from Paris.
Trying to build stuff there. First time i’m asking for help…

I have the attached workflow block that invokes my Agent. I am setting the result mode to ‘Sync’.
This should trigger my agent and then return the result once the agent has run.

Instead, it returns me something like this :

{
"data": {
"agentRunId": "019a98d7-ba94-739c-9104-3e543beef4ca",
"agentId": "f8825b24-cfe2-461e-a11b-41a5d718a3fa",
"status": "PENDING"
},
"metadata": null,
"value": null
}

My understanding is that this kind of answer is expected when ‘Run State (async)’ is selected. I do not understand why this block is not behaving like it should in terms of returning the result.

I have other blocks invoking other agents and they do not have this kind of issue.

Many thanks for anyone who might be able to set me on the right path.
Manesse

Hi @manesse_clam,

Welcome to the community forum!

This does look like the object being returned would be from an async call. That is odd that the block is not waiting for the agent to return a response.

I just tried to reproduce this and it didn't give me a similar return. Your mention that other blocks work fine leads me to suspect the block might be in a corrupted state, where even though you changed the Return Type in the UI, that the block still thinks it should be async.

If you delete the block and recreate it, does it give the same output? If you make the same logic in another workflow, does it return the same result?

Are you doing anything else specific after the Agent block?

Here is what I saw in my logs when attempting to recreate.

Simple Fix Steps

  1. Edit your agent workflow and add a final block that returns the result explicitly (like a Response block with the correct output).​

  2. Check the agent settings and logs for errors or long-running steps.

  3. Make sure your Retool platform is updated, and look in the workflow/agent settings for the "Result (sync)" or related sync/async setting to verify it’s enabled.​

  4. Test by creating a new simple agent to confirm if the issue is block-specific or Retool-wide; this can help isolate the problem.​

  5. If you keep getting only "PENDING" status, try restarting or redeploying your agent or workflow as a last resort.

1 Like