Workflows: Python AsyncIO Challenges

Whenever I attempt asyncio.run() processing, I get the following response from Retool: "RuntimeError: asyncio.run() cannot be called from a running event loop"

When I attempt to resolve this, I get the following response from Retool: "RuntimeError: This event loop is already running"

Ultimately this means I can't run async operations via Python. Is this in line with the documentation below? I know it mentions the Loop code block, but it doesn't specify non-Loop code block loop operations (perhaps it's meant to be assumed).

Python limitations​

JavaScript is the primary method for manipulating and transforming data in Retool. To maintain interoperability with other blocks, Python does not support:

  • Function block calls or triggering queries.
  • Usage within Loop and Filter blocks.
  • Data output in types other than serialized JSON.
  • User-imported Python libraries.

Hi @mbgs! I don't believe there is any inherent limitation to executing asynchronous Python code in a workflow. Can you try using the await syntax for your function call instead of asyncio.run? It should work then!