Skip to main content

foundry-temporal-agents

Status: Available Version Python

Temporal activities and clients for calling Strands agents from workflows, over the A2A (Agent-to-Agent) JSON-RPC protocol or the Query REST API. Depends on: foundry-temporal.

Install​

Install a released wheel from this repo's GitHub Releases. See Adopting these packages for the full flow - installing from a release tag for evaluation, or hosting the wheel in your own index for production, plus verifying the SBOM.

Quickstart​

Register call_strands_agent on your worker, then call it by name:

from datetime import timedelta

from temporalio import workflow

with workflow.unsafe.imports_passed_through():
from foundry_temporal_agents.retry import STRANDS_AGENT_RETRY_POLICY


@workflow.defn
class AgentWorkflow:
@workflow.run
async def run(self, agent_url: str, task: str) -> dict:
result = await workflow.execute_activity(
"call_strands_agent",
args=[agent_url, task, {}, None],
start_to_close_timeout=timedelta(minutes=5),
retry_policy=STRANDS_AGENT_RETRY_POLICY,
heartbeat_timeout=timedelta(seconds=60),
)
return {"result": result}

What's in the box​

SurfaceHighlights
A2A interfacecall_strands_agent activity, strands_agent_activity decorator, StrandsAgentClient
Query interfacecall_strands_query activity, strands_query_activity decorator, StrandsQueryClient
Dataclass activitiescall_strands_agent_dataclass, call_strands_query_dataclass, and matching decorators
DiscoveryAgentCapabilityChecker, AgentRegistry
Retry policiesSTRANDS_AGENT_RETRY_POLICY, STRANDS_LONG_OPERATION_RETRY_POLICY, get_strands_retry_policy (foundry_temporal_agents.retry)
ExceptionsStrandsAgentError and subclasses, including AgentAuthenticationError

Security​

  • Bearer authentication: A2A and Query requests send Authorization: Bearer <token> when FOUNDRY_AGENT_BEARER_TOKEN is set. A 401/403 fails the activity without retrying.
  • TLS posture: activities build their TLS context from FOUNDRY_TLS_MODE (platform by default, off as an alias for platform, tls, or mtls; TLS 1.2 minimum). See the README's TLS section.
  • Capability checks: when configured, the capability-discovery request is sent without the bearer token or TLS context.

Reference​