Skip to main content

Agent Types

interface AgentInput {
  message: string;
  file?: MediaFile;
  companyId?: string;
  userId?: string;
  sessionId?: string;
  executionId?: string;
  threadId?: string;
  entityType?: string;
  entityValue?: string;
  channel?: string;
  messages?: Message[];
  metadata?: Record<string, any>;

  /**
   * Raw HTTP request context — auto-injected by the platform only when
   * the agent is invoked via the direct HTTP Agent API.
   *
   * Not populated for webhook-triggered invocations (payload lives in
   * `metadata` instead), scheduled jobs, or direct SDK calls.
   *
   * Always guard access with optional chaining: `input.request?.body`.
   */
  request?: {
    body?: any;
    headers?: Record<string, string | string[] | undefined>;
    cookies?: Record<string, string>;
    query?: Record<string, string | string[] | undefined>;
    params?: Record<string, string>;
  };
}

interface AgentOutput {
  message: string;
  metadata?: Record<string, any>;
}

interface AgentConfig {
  name: string;
  instructions: string | PromptRef;
  model: ModelProvider;
  modelConfig?: ModelConfig;
  tools?: Record<string, RunflowTool>;
  maxToolIterations?: number;
  rag?: RAGConfig;
  memory?: MemoryConfig;
  media?: MediaConfig;
  streaming?: StreamingConfig;
  agents?: Record<string, AgentConfig>;
  debug?: boolean | DebugConfig;
  observability?: ObservabilityMode | ObservabilityConfig;
}

interface ModelConfig {
  temperature?: number;
  maxTokens?: number;
  topP?: number;
  frequencyPenalty?: number;
  presencePenalty?: number;
  stop?: string[];
  seed?: number;
}

interface DebugConfig {
  enabled: boolean;
  logMessages?: boolean;
  logLLMCalls?: boolean;
  logToolCalls?: boolean;
  logRAG?: boolean;
  logMemory?: boolean;
  truncateAt?: number;
}

Next Steps

Memory Types

View memory types

RAG Types

View RAG types