Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/agentex-tutorials-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test Tutorial Agents

on:
pull_request:
branches: [main]
branches: [main, next]
push:
branches: [main]
workflow_dispatch:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from typing import Any
from datetime import timedelta

from agentex.types.task import Task
from agentex.types.agent import Agent
Expand Down Expand Up @@ -41,6 +42,7 @@ async def submit_task(self, agent: Agent, task: Task, params: dict[str, Any] | N
),
id=task.id,
task_queue=self._env_vars.WORKFLOW_TASK_QUEUE,
execution_timeout=timedelta(seconds=self._env_vars.WORKFLOW_EXECUTION_TIMEOUT_SECONDS),
)

async def get_state(self, task_id: str) -> WorkflowState:
Expand Down
7 changes: 7 additions & 0 deletions src/agentex/lib/environment_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pathlib import Path

from dotenv import load_dotenv
from pydantic import Field

from agentex.lib.utils.logging import make_logger
from agentex.lib.utils.model_utils import BaseModel
Expand All @@ -32,6 +33,7 @@ class EnvVarKeys(str, Enum):
# Workflow Configuration
WORKFLOW_NAME = "WORKFLOW_NAME"
WORKFLOW_TASK_QUEUE = "WORKFLOW_TASK_QUEUE"
WORKFLOW_EXECUTION_TIMEOUT_SECONDS = "WORKFLOW_EXECUTION_TIMEOUT_SECONDS"
# Temporal Worker Configuration
HEALTH_CHECK_PORT = "HEALTH_CHECK_PORT"
# Auth Configuration
Expand Down Expand Up @@ -74,6 +76,11 @@ class EnvironmentVariables(BaseModel):
# Workflow Configuration
WORKFLOW_TASK_QUEUE: str | None = None
WORKFLOW_NAME: str | None = None
# Maximum total time (in seconds) a workflow execution can run, including
# retries and continue-as-new. Defaults to 24h to bound runaway workflows;
# agents with longer-running tasks should override this. Must be > 0 — a
# zero or negative timedelta would cause every submitted workflow to fail.
WORKFLOW_EXECUTION_TIMEOUT_SECONDS: int = Field(default=86400, gt=0)
# Temporal Worker Configuration
HEALTH_CHECK_PORT: int = 80
# Auth Configuration
Expand Down
Loading