I find that at times when I execute Generate Text, the AI model hangs. When I change to another AI model (Gemini to OpenAI), it proceeds. Can you help me implement a workflow to create a fallback option/alternative AI model in case that primary AI model hangs?
Hi @buboylav,
Gemini models have been unreliable this year and often return errors, so I’d generally recommend using a different provider.
As for fallback behavior, you can pair a Run Workflow block with a Router block. The Run Workflow block has an Error Behavior setting that lets the run continue even if the sub-workflow fails. The Router block can then check the Run Workflow block’s output variable to see whether the main model returned a result before triggering another workflow.
Here’s a remix link to a sample agent I built that demonstrates this approach:
https://app.mindstudio.ai/agents/image-generator-826dab3b/remix
I included a short script in the Gemini workflow that fails on every run, so you can see the fallback in action.
One thing to keep in mind is that the Run Workflow block needs a JSON array for its input variable, which is why there’s a tiny custom function right before it.