Workflow Agent Setup & Implementation
To build workflows in AI-Horizon Automaton, you define a structured set of Agents and Tasks compiled inside a Pipeline. Each agent has specific system instructions (personas), model parameters, and tools. Tasks define the inputs, target instructions, and outputs for those agents to execute.
1. Defining Agents
An Agent is defined by its role, back-end LLM parameters, and API configuration. Below is a Python configuration example of defining a research agent:
from aih import Agent
research_agent = Agent(
role="Market Analyst",
prompt_persona="""You are a senior market research analyst.
Your job is to search for economic trends and extract accurate indicators.
Be concise and highlight statistical metrics.""",
api_key="your_aih_api_key",
model="gpt-4o-glo-std",
temperature=0.1
)2. Defining Tasks
A Task is an actionable step assigned to a specific agent. It specifies what content to parse and what format the output should match:
from aih import Task
research_task = Task(
name="Market Trends Extraction",
description="Analyze the attached stock market data and extract top 3 gains and losses.",
agent=research_agent,
input_files=["./data/stock_market_2025.csv"],
output_path="./output/extracted_trends.json"
)3. Assembling the Pipeline
A Pipeline connects multiple tasks, orchestrating them sequentially and managing data passing between them:
from aih import Pipeline
market_pipeline = Pipeline(
name="Competition Analysis Pipeline",
tasks=[research_task, composition_task],
api_key="your_aih_api_key"
)
# Run the automation pipeline
run_results = market_pipeline.run()
print("Pipeline Run Status:", run_results.status)
print("Finished Artifact Location:", run_results.output_file)Configuration Variables
When launching pipelines via the dashboard or REST APIs, the following parameters define your workflow agent execution:
| Parameter | Type | Description |
|---|---|---|
name | string | Human-readable identifier of the workflow. |
tasks | Array | Ordered list of task configurations to execute. |
llm_params | object | Base model configurations (provider, engine, version). |
vector_store | object | Vector database configuration for shared task workspace memories. |