Using a Custom Action to Retrieve the Current Date and Time Before Each Call

  • Updated

This guide explains how to set up a custom action in your Synthflow AI account to retrieve the current date and time automatically for your specific timezone at the start of each call. By setting up this custom action, your assistant will always be aware of the exact local time, ensuring that interactions are timely and contextually accurate.

What You Will Learn:

How to create a custom action in your Synthflow account.
How to configure the custom action to send a GET request to the World Time API.
How to format the API endpoint with the correct parameters for your timezone (e.g., America/Chicago).

 

 

API Endpoint:

The custom action will use the following API endpoint:
http://worldtimeapi.org/api/timezone/:area/:location[/:region]

You will need to input your specific area, location, and optional region parameters. In most cases, just the area and location are enough (e.g., America/Chicago).

Why This Custom Action Is Useful:

By implementing this action, your AI assistant will always have up-to-date information about the current time, which is essential for time-sensitive communications, or referencing the current date and time in conversations. The API call runs automatically at the beginning of each interaction, enhancing the overall functionality of your AI assistant.

Additional Information:

If you need a complete list of available timezones, you can initiate a GET request to this endpoint:
http://worldtimeapi.org/api/timezone

This will return a list of all available timezone formats.