> ## Documentation Index
> Fetch the complete documentation index at: https://koreai-ai-for-work-dev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Script Task Node

Use this node to write a JavaScript script that processes context variables or other flow variables.

!!! Notes

* Form data can't be manipulated using a script.
* The script node doesn't create a step in the flow automatically. Steps must be explicitly designed on the canvas.

## Configure the Node

### General Settings

In **General Settings**, configure the following:

<img src="https://mintcdn.com/koreai-ai-for-work-dev/Z6dnCk8OSS21ESL3/ai-for-service/flows/node-types/images/general-settings-script-task.png?fit=max&auto=format&n=Z6dnCk8OSS21ESL3&q=85&s=4b1c71191322117247b3ae95327f0a1a" alt="General Settings" width="410" height="504" data-path="ai-for-service/flows/node-types/images/general-settings-script-task.png" />

1. **Custom Name**: Enter a name to identify the node.
2. **Define a Script**: Use the JavaScript editor to write the script to run.

### Connection Rules

Click the **Connection Rules** icon and select the target node for each outcome:

* **On Success**: The flow routes to this node when the script runs successfully.
* **On Error**: The flow routes to this node when the script fails.

<img src="https://mintcdn.com/koreai-ai-for-work-dev/y_m1Gv0LCU2NDHec/ai-for-service/flows/node-types/images/connection-rules-script-task.png?fit=max&auto=format&n=y_m1Gv0LCU2NDHec&q=85&s=071fb502c61ad533432fd13f473464c7" alt="Connection Rules" width="411" height="567" data-path="ai-for-service/flows/node-types/images/connection-rules-script-task.png" />
