---
title: "Get Session Script"
method: GET
path: "/sessions/{session_id}/workflow/code"
tags: ["sessions"]
---

# Get Session Script

`GET /sessions/{session_id}/workflow/code`

## Path parameters

- `session_id` string, required

## Query parameters

- `as_workflow` boolean, required — Whether to return code as standalone workflow or just relevant instructions
- `infer_response_format` boolean — Whether to infer response_format schema for scrape calls that have instructions but no schema

## Headers

- `x-notte-request-origin` string, nullable
- `x-notte-sdk-version` string, nullable

## Response `200`

Successful Response

- AgentFunctionCodeResponse
  - `python_script` string, required — Python script to replicate agent steps
  - `json_actions` object[], required — Json actions to replicate agent steps

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/notte/apis/notte-api.md) · [All operations](https://skmtc.net/notte/apis/notte-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/notte/notte-api/versions/246f6d21de0c/schema)
