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.
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
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.
Edit your agent workflow and add a final block that returns the result explicitly (like a Response block with the correct output).
Check the agent settings and logs for errors or long-running steps.
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.
Test by creating a new simple agent to confirm if the issue is block-specific or Retool-wide; this can help isolate the problem.
If you keep getting only "PENDING" status, try restarting or redeploying your agent or workflow as a last resort.
I'm having a slightly different error. I simply can't get the "Result (Sync)" option to work, it always returns with Internal Error running a block: Internal server error.
I tried duplicating the block, refreshing page, sending a test message, running the workflow with the play button, nothing seems to work. When going to the monitoring page in the Agents section, I don't even see the runs hitting the agent, so not really sure what's going on.
I was looking in Datadog over the past month and there doesn't seem to be logs associated with that ID
Is that workflow run from over a month ago? Are there more recent runs where you got this error? I may need a block/query ID to get more granular information on why that Agent block is failing.
I am reaching out to the workflows engineering team right now on this issue.
The logs I found gave me a very not helpful error message saying the request timed out
My hunch is that is a bug on our end we need to fix. Just to confirm, 'sync' mode always fails with that error, but does 'async mode work?
Does it fail regardless of which Agent is selected?
I just heard back from a member if our workflows team, they are curious if you are able to switch to async, using the Monitoring view to see how long the call is taking and can report that back.
As there is a 2-minute limit for sync workflows vs 10-minute for async.
So I just tried duplicating the workflow and duplicating the agent, still same error, so definitely seems a bug.
When I ran with async it works, and I can call it with another block. To be completely fair, I usually do this anyway and have my own polling block (as it was like that when agents first came out). However, I want to build a tutorial which is entirely no code, and having a polling js block completely defeats the purpose of it!
I am definitely confused why the sync method is timing out if the query is taking on average 30 seconds
I am working on another ticket as well where the issue is we currently do not have great visibility into the request leaving the Agent block and the response/error coming back to the agent block.
I am working with an engineer on the Agents team to see if we can add in some observability to make it easier to debug Agent blocks.
I understand that your reason for using sync instead of async is for a tutorial, which is frustrating as I wish this was a bug that was fixable from duplicating/rebuilding but it seems more stubborn of a bug
This bug is proving to be pretty tricky. It looks like you hunch may be correct, the workflow block is timing out and erroring before it is able to reach the Agent.
We found that from the ID you shared before that there was a heartbeat error in Temporal, this may be related to latency due to high traffic on our cloud servers.
I am waiting to hear back from one of the workflow engineers to find out if the part of our code that needs to run between the workflow block executing and the agent being invoked is hitting a 1 minute time out limit
Side question, which model are you using? The OCR param might be the one other factor that is slowing the block down.
Apologies the point I was making related to the OCR was the size of the data being passed in the agent query, not the operation itself.
I think you may need to come into office hours next week so we can check this out and see if we can figure out what the issue is
I just tested out the same prompt from your screenshot to a travel agent(mine is very simple, 2 tools maybe) and it completed in sync mode after about ~45 seconds.
Ah, well I didn't think about it because it's one page long at most....
Would you mind making a short video of how you configured yours? I've just don't know what else to try and I fear I'm missing something really obvious?
That definitely doesn't sound like too much data as an input. I am surprised this issue occurs even when the workflow and agent are re-build in different places
We may need to have you join us in office hours to tinker with the workflow/agent to see if we can get you unstuck on this.
I’m back here with the same issue in another flow. I wasn’t able to solve the problem in the previous flow. It broke my heart but I had eventually to use async mode for all my invoke blocks.
For the new workflow, here is what i see .
When invoking an AI agent in a retool block that is set to sync mode :
when using the ‘Run’ button in the worklfow builder, the the sync mode works fine
when triggering the workflow from an app, it goes to async mode for no reason.
when using interval or cron triggering : sometimes it goes to sync, sometimes it goes to async mode. Hard to find a pattern here but my guess here is that when an agent runs into an error (rate limit for example) it will go to async mode, and stay in that mode for the next runs.
Would love to hear back from you guys to see there might be any solution