Enhance Workflows with Tvara Beta v0.1

Ashish LalAshish Lal
4 min read

Introduction

In the last post, we explored what agents are and how they operate using tools and connectors. Now, it's time to build something with them: workflows - coordinated teams of multiple agents working together to accomplish a goal.

Workflows are end-to-end solutions designed to solve specific problem statements. Think of it this way: You want to buy an ice cream and deliver it to your friends at a park. One agent figures out the nearest ice cream shop, another places the order, a third handles the payment, and a fourth navigates the delivery route. Each agent handles a specific task, but together, they complete the full experience. That’s a workflow.

Visually, a workflow might look like this:

Types of Workflows

Hmm.. might look complex, but here’s the thing - in Tvara, we have statrted off simple by providing two types of workflows for devs - Sequential and Supervised.

  1. Sequential Workflow: In this workflow, you define a series of agents that are tightly connected to each other, working together to solve a task step by step. The output of one agent becomes the input for the next like a chain reaction.

    Use this for basic, linear tasks where all agents share a common context. Be aware that since the context is passed along, there's a higher chance of hallucinations if the task drifts too far from the initial input.

    Example:
    An agent summarizes a long article → the next agent translates the summary into Hindi → another agent extracts key points from the translated version.

  2. Supervised Workflow: Here, you define a supervisor agent, much like a project manager in a company. You assign a task to the supervisor, and it decides how to break it down, which agents are best suited to handle the sub-tasks, and how to coordinate everything.

    The supervisor collects results from the specialized agents and assembles them into a coherent final output.

    Use this for complex, collaborative tasks that benefit from domain-specific agents working independently under central coordination.

    Example:
    A user asks for a business strategy plan. The supervisor delegates tasks like market analysis, competitor research, and pricing suggestions to different agents, then compiles all the responses into a well-structured plan.

Creating Workflows with Tvara

Let us look at how easy it is to create workflows using Tvara. (For in-depth code understanding, I would suggest you to checkout the README.md on Tvara Repo.

Install Tvara using the following command:

pip install tvara

Sequential

Let’s create a sequential workflow where we want to research a topic and then write a blog based on that research.

from tvara.core import Agent, Workflow, Prompt
from tvara.tools import DateTool, WebSearchTool
import os
from dotenv import load_dotenv

load_dotenv()

# Step 1: Researcher Agent
researcher_agent = Agent(
    name="Researcher Agent",
    model="gemini-2.5-flash",
    api_key=os.getenv("MODEL_API_KEY"),
    prompt=Prompt(
        raw_prompt="You are a researcher tasked with gathering information on a specific topic. Use the tools available to you to find relevant information and summarize it.",
        tools=[WebSearchTool(api_key=os.getenv("TAVILY_API_KEY")), DateTool()]
    )
)

# Step 2: Blog Writing Agent
blog_agent = Agent(
    name="Blog Agent",
    model="gemini-2.5-flash",
    api_key=os.getenv("MODEL_API_KEY"),
    prompt=Prompt(
        raw_prompt="You are a blog writer. Use the information provided by the Researcher Agent to write a comprehensive blog post.",
    )
)

# Workflow definition
my_workflow = Workflow(
    name="Sample Sequential Workflow",
    agents=[researcher_agent, blog_agent],
    mode="sequential",
)

# Running the workflow
result = my_workflow.run("Write a blog post under the name of Tvara Community about the latest advancements in AI research.")

That’s it!
All we had to do was define the agents in the desired sequence - and done!

Supervised

Now, let’s create a supervised workflow where we want to:

  1. Fetch the latest README.md of a GitHub repo

  2. Summarize it

  3. Send a message in a cheerful business tone to a Slack channel

Sounds complex? Let’s simplify it with Tvara:

from tvara.core import Agent, Workflow, Prompt
from tvara.connectors import GitHubConnector, SlackConnector
from dotenv import load_dotenv
import os

load_dotenv()

# Agent 1: GitHub Fetching
github_agent = Agent(
    name="GitHub Agent",
    model="gemini-2.5-flash",
    api_key=os.getenv("MODEL_API_KEY"),
    connectors=[GitHubConnector(name="github", token=os.getenv("GITHUB_PAT"))]
)

# Agent 2: Summarization
summarizer_agent = Agent(
    name="Summarizer",
    model="gemini-2.5-flash",
    api_key=os.getenv("MODEL_API_KEY"),
)

# Agent 3: Slack Messaging
slack_agent = Agent(
    name="Slack Agent",
    model="gemini-2.5-flash",
    api_key=os.getenv("MODEL_API_KEY"),
    connectors=[SlackConnector(name="slack", token=os.getenv("SLACK_BOT_TOKEN"))]
)

# Supervisor Agent
manager_agent = Agent(
    name="Manager Agent",
    model="gemini-2.5-flash",
    api_key=os.getenv("MODEL_API_KEY"),
    prompt=Prompt(
        raw_prompt="You are a workflow manager coordinating multiple AI agents. Your job is to decide what should happen next."
    )
)

# Supervised Workflow Definition
my_workflow = Workflow(
    name="Sample Workflow",
    agents=[github_agent, summarizer_agent, slack_agent],
    mode="supervised",
    manager_agent=manager_agent,
    max_iterations=3,
)

# Running the workflow
result = my_workflow.run(
    "Send the latest readme file of the tvara repository by tvarahq on GitHub to the Slack channel #test-channel. "
    "Ensure you send a summary only, written in a cheerful product launch business tone!"
)

And just like that, define a few agents, assign a manager… voilà!
The message appears in your Slack channel.

Attaching a screenshot of this cool result:

What’s Next?

Based off these examples, I would want to see more examples coming out from the community along with contributions that would help and improve the SDK itself.

In the next post, we would look into how these workflows work under the hood. This would add more clarity for developers to create their own workflows and contribute better!

Until then, Enjoy!

2
Subscribe to my newsletter

Read articles from Ashish Lal directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ashish Lal
Ashish Lal