Skip to main content

Core Exports

import { Agent, Runflow, openai, anthropic, bedrock } from '@runflow-ai/sdk';

AgentInput.request

When an agent is invoked via the direct HTTP Agent API, the platform auto-injects the raw HTTP request context on input.request. Useful for reading custom headers, cookies, query params, or path params without re-wrapping the agent in a controller.
export async function main(input: AgentInput) {
  const traceId = input.request?.headers?.['x-trace-id'];
  const lang    = input.request?.query?.lang ?? 'pt-BR';
  // ...
}
input.request is not populated for webhook-triggered invocations (the payload lives in metadata instead), scheduled jobs, or direct SDK calls. Always guard access with optional chaining. See Core Types → AgentInput for the full field list.

Next Steps

Tools & Connectors

View tools exports

Workflows

View workflow exports