---
title: "按会话查找自动化"
method: GET
path: "/automations/by-session/{session_id}"
tags: ["自动化"]
---

# 按会话查找自动化

`GET /automations/by-session/{session_id}`

## Request

- Base URL: `/api/v1` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/v1/automations/by-session/{session_id}`
- Auth: API key in header `Authorization`

返回这次会话所属的自动化，供会话页跳回

## Path parameters

- `session_id` string, required

## Response `200`

自动化

- object
  - `data` GithubComTencentWeKnoraInternalTypesAutomation
    - `access_level` 'read_only' | 'confirm' | 'auto_write'
    - `active_run_status` string: ActiveRunStatus is projected from live runs and is not persisted.
    - `approval_timeout_minutes` integer: ApprovalTimeoutMinutes is how long a run waits for an approval before it fails.
    - `carry_last_result` boolean: CarryLastResult adds the last successful answer to each per-run conversation.
    - `consecutive_failures` integer
    - `created_at` string
    - `description` string
    - `enabled` boolean
    - `id` string
    - `instruction` string: Instruction is the task, sent as the user message of each run after its variables are filled in.
    - `last_run_at` string
    - `last_run_status` string
    - `last_success_at` string
    - `limits` GithubComTencentWeKnoraInternalTypesAutomationLimits
      - `max_duration_minutes` integer: MaxDurationMinutes caps a run's execution time, not counting time spent waiting for approval. 0 uses the default.
    - `misfire_policy` string
    - `model_id` string: ModelID overrides the assistant's chat model; empty follows the assistant default.
    - `name` string
    - `next_run_at` string
    - `notify_on_success` boolean
    - `overlap_policy` string
    - `owner_user_id` string: OwnerUserID is the account the automation runs as.
    - `paused_reason` string
    - `persistent_session_id` string: PersistentSessionID is the conversation of a persistent automation, created on its first run.
    - `session_mode` string
    - `tenant_id` integer
    - `trigger` GithubComTencentWeKnoraInternalTypesAutomationTrigger
      - `at` string: At is when a once trigger fires, RFC3339 or a wall-clock time in Timezone, such as "2006-01-02T15:04:05" or "2006-01-02 15:04".
      - `expr` string: Expr is a cron expression: five fields (minute first) or six (seconds first), or a descriptor such as @daily.
      - `timezone` string: Timezone is an IANA zone, e.g. Asia/Shanghai; empty means UTC.
      - `type` string: Type is cron or once.
    - `updated_at` string
  - `success` boolean

## Other responses

- `404`: 不存在

## Changes

- **2026-10-26** `685d1f9fce30`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/tencentblueking/apis/weknora-api/changes/automations/by-session/:session_id/get.md)

---

[API](https://skmtc.dev/tencentblueking/apis/weknora-api.md) - [All operations](https://skmtc.dev/tencentblueking/apis/weknora-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tencentblueking/apis/weknora-api/revisions/685d1f9fce30?raw)
