---
title: "Execute Script"
description: "Execute server-side JavaScript directly or from node attachments with customized configurations. (Gitana 4.0)"
product: "Gitana"
version: "4.0"
url: "/documentation/gitana/4.0/engine/behaviors/actions/execute-script"
---

# Execute Script

ID: `executeScript`

Executes custom server-side JavaScript that is provided inline, in the `script` property of the action's configuration. To run a script that is stored as an attachment of a node, use the [Execute Script from a Node](/documentation/gitana/4.0/engine/behaviors/actions/execute-script-from-node.md) action instead.

### Configuration

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| script | text | true |  | String containing the script. |
| scriptMimetype | text | false | application/javascript | The mimetype of the script. |
| methodName |  | false |  | The method name of the script. |
| args |  | false |  | The arguments for the method in the script. |

## Example

```
{
    "script": "if (typeof(node.data.count) === 'undefined') { node.data.count = 0; }; node.data.count++;"
}
```

## See Also

- The "Scripts" section of [Rules](/documentation/gitana/4.0/engine/behaviors/rules.md)
- The [Script](/documentation/gitana/4.0/engine/workflow/workflow-handlers/script.md) workflow handler, which runs a script based on the items in a workflow
