This is a cache of https://developer.ibm.com/tutorials/build-scheduled-agentic-workflow/. It is a snapshot of the page as it appeared on 2025-11-29T03:20:49.612+0000.
Build a scheduled agentic workflow for daily notifications - IBM Developer
Build a scheduled agentic workflow for daily notifications
A practical example of building, importing, and scheduling an agentic workflow that automatically sends daily email notifications using watsonx Orchestrate
In an agentic AI system, multiple agents work on their own for managing tasks such as collecting data, making decisions, communicating, and taking actions. But some actions need to happen at the right time, not immediately. Many business processes depend on timing such as running something after a delay, at a specific time, or on a regular schedule. For example:
Set the Data Backup Agent to run daily at 11:30 PM
Run this monitoring tool every hour for the next 24 hours
These instructions create the foundation for scheduled agentic workflows. Scheduling agent actions keeps each workflow running smoothly and ensures tasks occur on time. This scheduling capability shifts an agentic system from reactive automation to proactive orchestration, where each agent can think, act, plan, and time its actions in a smart way.
Create reusable tools and combine them into agentic workflows that send a motivational quote to your inbox every morning without writing any cron jobs.
Use enterprise email servers such as Gmail for email delivery.
Schedule and monitor the automation in the watsonx Orchestrate user interface (UI), bringing AI orchestration, scheduling, and practical task execution into one place.
Architecture of daily quote scheduler
The architecture shows how a user can schedule events through conversational chat with AI agents.
The user types “Schedule a daily quote email every day at 7 AM IST” in the web chat. This input triggers the orchestration flow.
The request is routed to the Daily Quote Agent, which analyzes the request and selects the Send email Tool Flow as the next required action.
The tool flow is a scheduled event or flow in watsonx Orchestrate. It runs at 7 AM IST every day. The custom email tool in the flow sends an email to the specified recipients.
This setup is an example of an asynchronous process, useful when a task must run at a specific time, either one time or on a recurring schedule.
Prerequisites
A local environment running the watsonx Agent Development Kit (ADK) version 1.15 or later. This tutorial was tested with ADK version 1.15.
Python 3.11 or later. This tutorial was tested with Python 3.13.
An active watsonx Orchestrate instance. You can create a free trial instance of watsonx Orchestrate SaaS on:
A mail account with an app password enabled. In this tutorial, you will use Gmail. You can also use SendGrid, Outlook, or IBM SMTP by updating your email tool credentials.
Locate the file connections/gmail_connection.yaml.
Run the following command from the connections folder.
## Import the Connection
orchestrate connections import -f gmail_connection.yaml
Copy codeCopied!
To set the credentials for draft and live environments, update the following command with your GMAIL_USER and GMAIL_APP_PASSWORD values and then run the command.
Validate the connection setup in watsonx Orchestrate ADK.
## Verify the Connection
orchestrate connections list
Copy codeCopied!
Step 2. Create the tools in watsonx Orchestrate ADK
Create the custom send_gmail_notification tool. This Python tool sends emails through Gmail using a secure SMTP connection. It enables automated email delivery from watsonx Orchestrate.
Open the agents folder in VS Code and locate the file send_mail_gmail.py.
Import this tool into watsonx Orchestrate using the watsonx Orchestrate ADK command line interface (CLI).
A confirmation message is displayed after the tool is successfully imported.
Step 3. Build an agentic workflow to connect the tools
Create an agentic workflow that links the quote generator tool and the email notification tool. This workflow calls the get_quote_min tool to fetch a quote and then sends that output to the email_test_agent agent for notification delivery.
In the same working directory within VS Code, locate the predefined workflow tools/daily_quote_flow_min.py file.
The workflow defines a schedulable flow named daily_quote_flow_min. It first runs the get_quote_min tool, then passes the result to an AgentNode called notify_user_via_agent, which sends the quote by using the email_test_agent agent.
Because schedulable=True, this workflow appears in the watsonx Orchestrate scheduler, allowing users to create time-based triggers without writing additional code.
Step 4. Create the agents in watsonx Orchestrate
Create two following agents to complete the workflow setup.
Email test agent: The email_test_agent uses the send_email_notification tool so that other workflows or agents can send email notifications through it.
Scheduler agent: The daily_quote_agent acts as a scheduler. This agent uses both custom tools and intrinsic tools to run and manage scheduled workflows.
Custom tools are written in Python and can be modified to fit your use case.
Intrinsic tools are provided by the watsonx Orchestrate ADK and cannot be modified. These tools support scheduling, monitoring, and management of workflows.
The purpose of each tool used by the scheduler agent follows:
daily_quote_flow_min: uns the workflow that generates and sends the quote.
i__get_flow_status_intrinsic_tool__: Retrieves workflow status and run history.
i__get_schedule_intrinsic_tool__: Lists active schedules.
i__delete_schedule_intrinsic_tool__: Deletes a schedule using its schedule_id.
These tools allow the scheduler agent to run, monitor, list, and manage scheduled workflows, enabling recurring automation in watsonx Orchestrate.
Import the agents/schedule_daily_quote_agent.yaml scheduler agent by using the watsonx Orchestrate ADK CLI.
Step 5. Import the tools and the agentic workflow into watsonx Orchestrate
Import the schedulable workflow by running the following command in the terminal from the tools directory in VS Code.
About cookies on this siteOur websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising.For more information, please review your cookie preferences options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.