🎥Running Agents on Tess with N8N: How to Get Immediate or Non-Immediate Responses | Get to know the WaitExecution🗒️

There are two main approaches to obtain responses from an agent in Tess AI: one that provides immediate answers and another that allows for some delay. The choice between the two depends on the nature of the task and the time you can (or must) wait

 

The use of agents with APIs can be a bit more complex, especially for beginners. One of the first obstacles many face is dealing with the absence of instant responses after executing an agent or a longer wait time. Let's explain it better today!

Conceptualizing the Agent Response

When triggering an agent in Tess AI and automating its execution, it is essential to understand that, in some situations, you may not receive an immediate response (as is the case with more complex agents, for example).

When you send a message to the agent, it is possible that the output may be empty, even if the agent has generated a response. This happens because, often, no command was provided to instruct the agent to return a response directly on the platform when requested.

Adjusting the Request for Immediate Responses

A simple way to ensure that you receive a response from the agent is to configure the variable WaitExecution as True. This configuration informs the agent that the response should be sent as soon as it is ready. For example, if you send a message like "Hi, how are you?" and have WaitExecution configured as False, you will not receive an immediate response, as in a fluid interaction, but if you configure it as True, the agent's response will be returned immediately.

However, it is necessary to assess the context of use, as this approach is not always the most efficient. If the task the agent needs to perform is complex or it needs to process several steps, waiting for a response might result in timeouts or errors, especially in cases that require more time for computation.

When to Use Non-Immediate Requests

For situations where the response does not need to be immediate, such as generating reports or tasks that occur during scheduled events (for example, a report scheduled for 6 a.m.), it is more efficient not to use the WaitExecution configuration we have seen. In these cases, you can simply send the execution request and later retrieve the response. (you can access our documentation for this)

How to Retrieve Non-Immediate Responses

To get the response in a non-immediate scenario, you need to take a few additional steps. After executing the request, wait for a certain period—this can be done using a wait node, which is common in automation tools like N8n, Make, or Zapier. After the waiting time, you need to make a new request using the GET method to fetch the agent's response.

It is crucial at this point to include the response identifier in your new request. This ID is the key that will allow you to retrieve the specific results generated by the agent after the initial execution.

Conclusion

There are two main approaches to obtaining responses from an agent in Tess AI: one that provides immediate answers and another that allows a certain delay in the response. Choosing between these two depends on the nature of the task and the time you can wait for a response. Understanding these dynamics is essential to optimize your interactions with Tess AI and ensure that your requests are handled efficiently!

If you want to dive deeper into how to call an agent via the API or configure these parameters, don't forget to check out additional materials, which can be valuable for enhancing your Tess AI usage skills!