> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notte.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# getScript

<Tip>
  Read [the Notte skill](https://notte.cc/skill.md) and follow its setup instructions when setting up Notte or building browser automation. This is the shared source for CLI setup, authentication, and the browser-to-code workflow.
</Tip>

[Source: node-sdk/src/session.ts](https://github.com/nottelabs/notte/blob/main/node-sdk/src/session.ts)

Get the workflow code generated from the session steps
(`GET /sessions/{id}/workflow/code`).

```typescript theme={null}
Session.getScript(options?: SessionScriptOptions): Promise<AgentFunctionCodeResponse>;
```

## Parameters

<ParamField body="options" type={"SessionScriptOptions"}>
  Default:

  ```typescript theme={null}
  {}
  ```
</ParamField>

## Returns

```typescript theme={null}
Promise<AgentFunctionCodeResponse>
```

## Example

```typescript theme={null}
const { python_script } = await session.getScript();
```

## Related types

* [AgentFunctionCodeResponse](/typescript-sdk-reference/types/agentfunctioncoderesponse)
* [SessionScriptOptions](/typescript-sdk-reference/types/sessionscriptoptions)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.