Time
The Time Node provides tools for working with time and scheduling in your Stack AI workflows. It is especially useful for automating tasks based on time, retrieving the current time in various formats and timezones, and determining the day of the week for any date.
Available Actions
1. Task Scheduler
Purpose: Schedule tasks to run other tools or actions at specific times using cron expressions.
Inputs:
cron_expression (required): The cron schedule (e.g., "0 9 * * *" for 9am daily).
Note: You cannot schedule more frequently than daily.
title (required): A short, descriptive title for the scheduled task (do not include time info here).
human_expression (required): A human-readable description of the schedule (e.g., "every Monday at 9am").
instructions (required): Detailed instructions for what the scheduled task should do (do not include timing info here).
timezone (optional, default "UTC"): The timezone for the schedule (e.g., "America/New_York").
Outputs:
id: The ID of the scheduled task.
cron_id: The cron job’s unique identifier.
result_msg: A message describing the result of the scheduling action.
When to use:
To automate recurring tasks (e.g., daily reports, weekly reminders, periodic data scraping).
When you want to trigger actions at specific times or intervals.
2. Current Time
Purpose: Retrieve the current time in a specified timezone and format.
Inputs:
timezone (optional, default "UTC"): The timezone for the current time (e.g., "Asia/Tokyo").
format (optional, default "%Y-%m-%d %H:%M:%S"): The output format for the time (e.g., "YYYY-MM-DD HH:MM:SS").
Outputs:
current_time: The current time as a string, formatted as specified.
When to use:
When you need to timestamp actions, logs, or outputs.
To display or use the current time in a specific timezone.
For time-based logic in your workflow.
3. Weekday
Purpose: Determine the day of the week for a given date.
Inputs:
year (required): The year (e.g., 2025).
month (required): The month (1-12).
day (required): The day (1-31).
Outputs:
weekday: The name of the weekday (e.g., "Monday").
When to use:
For scheduling or logic that depends on the day of the week.
To check if a date falls on a weekend or a specific weekday.
For calendar-based automations.
How to Use the Time Action Node
Add the Time action node to your workflow.
Select the desired action (Task Scheduler, Current Time, or Weekday).
Fill in the required input fields as described above.
Connect the node to other nodes as needed (e.g., to trigger actions, provide time info to LLMs, or control workflow logic).
Example Use Cases
Task Scheduler: Automate scraping a website every Monday at 9am.
Current Time: Add a timestamp to a generated report in the user’s local timezone.
Weekday: Only send notifications if today is a weekday.
Last updated
Was this helpful?