> ## Documentation Index
> Fetch the complete documentation index at: https://koreai-ai-for-service-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-service-dev/zDdCnsXYR4u1BVq5/ai-for-service/flows/node-types/images/general-settings-script-task.png?fit=max&auto=format&n=zDdCnsXYR4u1BVq5&q=85&s=ffbb90ca15608b2cee014d0ab48418a1" 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-service-dev/p9OfqDijzOkZtYNJ/ai-for-service/flows/node-types/images/connection-rules-script-task.png?fit=max&auto=format&n=p9OfqDijzOkZtYNJ&q=85&s=63d32468746e72e9528171dc0a75c104" alt="Connection Rules" width="411" height="567" data-path="ai-for-service/flows/node-types/images/connection-rules-script-task.png" />
