Need help with Agentic Workflow

:bullseye: What is your goal?

To generate a quote based on defined criteria and instructions.

:thinking: What is the problem & what have you tried?

Sometimes the agent just thinks for a long time (over 5 minutes), uses the tools that I assigned it to use but then nothing happens and the scenario throws an error.

:clipboard: Error messages or input/output bundles

When I go check the log, it shows all the process and tools used as if the scenario was completed.

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Hey Gian!
Actually, I can relate to this from when I first building AI agents in Make and attaching all the necessary tools.

However, I ended up wondering when to use a deterministic versus a non-deterministic workflows for automation.

I’m also curious about how many tokens the AI agent module consumes during processing?

-John

Select a recent run and then check the output of the agent itself for clues not only the log. Ensure your prompt has an explicit instruction on tool use workflow and conditions, also ensure that the tools added to the Agent are exactly named and exactly referenced in the prompt.

Is your Agent Step Timeout set to 600?

Should the context of all the tools be excessive or even a single tool exceed the step timeout setting, it will fail.

As @johnai.tech said, if possible try some deterministic flows for data extraction if possible and then determine which activities or processes absolutely requires an AI agent (LLM) to orchestrate the output.

I do have an alternative setup that could address your problem, but would need a little more context?

@johnai.tech @NeillHuman

Hey, just to give you some context:

This agent lives inside WhatsApp and it’s job is to generate a quote for logistic/transportation services. First it asks the client for all the variables that it needs in order to make the calculations for the quote. Quoting these types of services is a very complex process but the idea here is to simplify it as much as possible to send out an initial quote, fast.

That’s why I connected so many tools to the agent (docs, spreadsheets, google maps for distance between points, etc). That’s where he needs to get the prices from. For example if the user selected a specific truck or van, the agent needs to check the cost/mile for that unit, then multiply it by the distance between the origin and destination, etc.

I just ran it right now and it consumed 19,000 credits for a single run. I’m using Make’s AI provider: GPT 5.4

I switched from GPT 5.4 mini because it was not completing the runs, but now it is with 5.4

I think the credit usage is absolutely ridiculous, but maybe it’s normal based on the complexity of the tasks…

Ok that is great context.

That is a lot of credits and does illustrate the complexity of the request.

I can however gather from the example that you have given that a lot of that can be solved deterministically and programatically.

Given this example, and the number of tools added, I can assure you that the agent wastes a lot of tokens figuring out where to go and what to do and you risk context bloat and hallucinations as this bloats.

Maybe consider using the AI agent to gather the required intel first from user inputs and deliver structured JSON to a datastore with vehicle type, distance, fuel type, payload, weather conditions, etc. → then router if distance unknown to google maps for distance calculation, updating datastore in that route or alternative route moves into async search rows in google sheet for vehicle type, getting fuel economy, then into a function that then multiplies the required variables mathematically to deliver the figure. Even input live fuel pricing data if required HTTP GET if you have a reliable online source to keep datastore updated.

Eventually, maybe end in another separate AI agent that synthesizes this JSON and variables, without needing to reference all those sheers with individual tool calls.

I would even structure this as separate scenarios if needed.

Bottom line, the non-deterministic nature of the AI agent is wasting tokens, trying to figure out what is relevant in what appears to be a wealth of info.

You could even try creating a structured knowledge base for the AI agents that guides it more accurately in its decision process, with operating procedures, etc.

I like the application you are working on, so I am eager to help more if the above helps you at all.

Hey Neill,

Sounds good. I like your approach. There are a couple of details that are important but regardless I think that your structure works.

Are you open for a Google Meet today/tomorrow?

Please create an execution algorithm for the agent to be more deterministic and for such complex workflows you should consider using more than one agent on make.

If I understand you well, the agent on make is just here to help that whatsapp agent (not on make) to generate a quote that the whatsapp agent will use. The whatsapp agent on the other hand gathers the required input variables from the potential client and then sends them to make.com for the agent to use Google maps and other info from spreadsheets etc. to generate a quote.


Though you’ve given little context, I think your token usage will be ridiculous. Let your whatsapp agent hand over a form with input validation to clients who agree to get a quick quote. Send the data to make.com use google’s routes api if you need turn by turn distance and use distance matrix api if you need city to city. This keeps you off ai tokens and you already have the most important thing “distance”. For your use cases I believe city to city works best.

BAD ADVICE Hack: This shortcut works for me but don’t use it if stakes are too high. For city to city distance make.com websearch tool will kill that with a 100% accuracy. Test it 10 times with your real validated distance input data. 10 times, if it works then it’s reliable in your use case because it grabs data directly from Google searches and others, and Google searches have solid distance calculations capabilities that will wow you. You can use a formula to grab the distance from the research response or get a json response.


Next, add the distance to the form input data that you feed to the AI agent. At this point the execution algorithm shines. Detail the steps that the AI must use. Now imagine you were the one to create a quote for that client, you’re holding a pen and paper right now. Where will you start and where will you end with the quote? An answer to this question gives you the execution algorithm instead of letting the agent run on free mode or a vague instruction.

Give the agent structure on how to start which tool to use before which and when to use, what success looks like at every stage. Etc.

DON’T FETCH ENTIRE SPREADSHEETS​:folded_hands:. Use smart search to pull only required data and if I were you I would use low level, low token determined ministeps to generate different parts of the quote and then append them somewhere.

Personally I LOVE JSONs. I would get the agent to produce a quote json format. Make.com AI agents absolutely love this and I bet your out of make AI powered whatsapp agent can use both a json parser and renderer to give your client a solid quote pdf if your whatsapp agent had pdf tools and a template that it feeds the json from the make.com agent to generate a unique and neat quote pdf for that specific client.



Another importance of handing your clients using a form is the fact that input validations can give you uniform data and you’ll have little processing to do because different clients will explain their needs to the whatsapp agent in different ways. The only bottleneck here is that you need to know which whatsapp ID has which input. You can explicitly add a whatsapp number field to the form but that can give room for errors so if I were you I would use whatsapp flows.

If you can setup a whatsapp business cloud api for your agent then it’s feasible to set whatsapp flows so that the agent gets users to fill the form right within whatsapp with the perfect input validation and then hands that over to your make scenario to generate the quote json. This can add the user’s whatsapp ID which can still be included in the json so long as the whatsapp agent understands the structure and key pairs.


Another BAD ADVICE that works for me: if your spreadsheet isn’t huge like you don’t have hundreds of car types and thousands of pricing variations you can carefully place your spreadsheet data into rag because once your user input data contains words present in the rag the make AI agent will pull it as input context which is even sweeter for json generation and grossly reduces the agent steps and tokens.

To update pricing per mile and per car? Just update your rag. Even the data pulled from the spreadsheet is still injected as part of the input context and still goes through tokenization, self attention and softmax.

All these can shrink your 19,000 credits to maybe less than a hundred credits per quote which will make your automation profitable.

Unconventional takes I’d say but I hope this helps a little.

Hey everyone, thanks for the input.

I was able to solve my issue and I just wanted to share how I re-built the workflow. It took me about 3 days to re-build, test and deploy.

Since a lot of the process was very deterministic, I simply set my agent to capture the data I needed, store it in a Data Structure and then I simply used that data throughout the rest of the workflow.

So the agent doesn’t really take any complex actions, keeping token/credit usage low.

Hope this helps anyone else in a similar situation.