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

# UDF

The **UDF** menu allows you to manage your
*User-Defined Functions (UDFs)*. The **UDF** menu is only
available if *UDFs* have been enabled.  See [User-Defined Function Implementation](/content/udf) for *UDF*
configuration requirements and [User-Defined Functions Overview](/content/udf_overview) for detail on *UDFs*
themselves.

<Note>
  The **UDF** section is only available to users
  with the `system_admin` role or the `proc_execute` permission.
</Note>

## UDF

**UDF** is the *UDF* homepage and allows executing, creating,
editing, and deleting *UDFs*. For more detail on Running UDFs, see the
[Running Python](/content/udf/python/running) or
[Running C++](/content/udf/cpp/running) UDF pages
(depending on your preference).

<img src="https://mintcdn.com/kinetica/1z8mB2CQRb2B9bKF/content/admin/images/udf_procs.png?fit=max&auto=format&n=1z8mB2CQRb2B9bKF&q=85&s=f3ee241b8e6ae907b4ba6712b7207df0" alt="../../images/udf_procs.png" width="847" height="196" data-path="content/admin/images/udf_procs.png" />

### Creating Procs

Click **New** to create a new proc.

<img src="https://mintcdn.com/kinetica/1z8mB2CQRb2B9bKF/content/admin/images/udf_procs_new.png?fit=max&auto=format&n=1z8mB2CQRb2B9bKF&q=85&s=1f9d8dd56ac64bb6f6c5a0417be47696" alt="../../images/udf_procs_new.png" width="940" height="506" data-path="content/admin/images/udf_procs_new.png" />

Provide the name of the proc, command necessary to run the proc file (e.g.,
`python`), and any command-line arguments (e.g., custom *Python* or *C++*
arguments; click **Add** to add additional arguments), then fill
the **Distributed** checkbox if the *UDF* should be in
distributed mode and fill the
[Limit Concurrency](/content/udf/concurrency_limits#concurrency-limits) checkbox and type a number
to set a concurrency limit. Finally, upload a proc file(s) by clicking
**Choose file(s)** and selecting the proc file(s) from your
computer.

Here's an example of a proc being created in GAdmin:

<img src="https://mintcdn.com/kinetica/1z8mB2CQRb2B9bKF/content/admin/images/udf_procs_new_filled.png?fit=max&auto=format&n=1z8mB2CQRb2B9bKF&q=85&s=26baa6f1e5c36150dfc3d3ec1f9376ac" alt="../../images/udf_procs_new_filled.png" width="940" height="546" data-path="content/admin/images/udf_procs_new_filled.png" />

### Executing UDFs

To execute a UDF, click a *UDF* then click **Execute**.

<img src="https://mintcdn.com/kinetica/1z8mB2CQRb2B9bKF/content/admin/images/udf_procs_execute.png?fit=max&auto=format&n=1z8mB2CQRb2B9bKF&q=85&s=89f852b887b62ce1a777b7334a136a84" alt="../../images/udf_procs_execute.png" width="940" height="546" data-path="content/admin/images/udf_procs_execute.png" />

Provide a run tag if desired (see [/execute/proc](/content/api/rest/execute_proc_rest) for
more information on run tags), click **Add** to add additional
parameter names and values, input tables and columns, and/or output tables, then
click **Execute**.

Here's an example of the same proc being set up for execution in GAdmin:

<img src="https://mintcdn.com/kinetica/1z8mB2CQRb2B9bKF/content/admin/images/udf_procs_execute_filled.png?fit=max&auto=format&n=1z8mB2CQRb2B9bKF&q=85&s=d3ce28a6b8a6600c7685d9d5e55a7514" alt="../../images/udf_procs_execute_filled.png" width="940" height="687" data-path="content/admin/images/udf_procs_execute_filled.png" />

### Editing UDFs

To edit a *UDF*, select a *UDF* then click **Edit**. Edit the
name or command as necessary, then add or edit arguments. Select the
**Distributed** checkbox if the *UDF* should run in distributed
mode, or clear the checkbox if the *UDF* should run in non-distributed mode.
Select the **Limit Concurrency** checkbox and adjust the setting
to set a concurrency limit, or clear the checkbox to remove the limit. Once
editing is finished, click **Save**.

<Note>
  You cannot change the file for the proc once it has been
  uploaded.
</Note>

<img src="https://mintcdn.com/kinetica/1z8mB2CQRb2B9bKF/content/admin/images/udf_procs_edit.png?fit=max&auto=format&n=1z8mB2CQRb2B9bKF&q=85&s=09194e7749843457ad5595996d236ea8" alt="../../images/udf_procs_edit.png" width="940" height="546" data-path="content/admin/images/udf_procs_edit.png" />

### Deleting UDFs

To delete a *UDF*, select a *UDF* then click **Delete** and
confirm the deletion of the selected *UDF*.

### Permissions

To adjust the permissions of a particular *UDF*, select a *UDF* then click
**Permissions**. A list of available users and roles will display
alongside lists of users and roles that have the `proc_execute` permission for
the selected *UDF* as well as `proc_execute` permission for all *UDFs*.

<img src="https://mintcdn.com/kinetica/1z8mB2CQRb2B9bKF/content/admin/images/udf_permissions.png?fit=max&auto=format&n=1z8mB2CQRb2B9bKF&q=85&s=2fa8ee18dd0575babb692d37d5fad988" alt="../../images/udf_permissions.png" width="965" height="656" data-path="content/admin/images/udf_permissions.png" />

<Note>
  To grant a user or role execute permission to all procs, the
  `proc_execute` will need to be applied via the
  [Security](/content/admin/gadmin/security) page.
</Note>

* Edit execute permissions for users:

  * *Add*: Click a user in the **Available** list and then click
    **Grant >>** to grant the user `proc_execute` permission on
    the selected UDF.
  * *Remove*: Click a user in the **Proc-level Granted** list and
    then click **\<\< Revoke** to revoke the user's
    `proc_execute` permission on the selected UDF.

* Edit execute permissions for roles:

  * *Add*: Click a role in the **Available** list and then click
    **Grant >>** to grant the role `proc_execute` permission on
    the selected UDF.
  * *Remove*: Click a role in the **Proc-level Granted** list and
    then click **\<\< Revoke** to revoke the role's
    `proc_execute` permission on the selected UDF.

## Status

**Status** displays active, idle, and completed procs. Like
[Job Manager](/content/admin/job_manager), this page is automatically refreshed based on
the selected interval, so you can see procs' statuses and total run time update
at each interval. This page can be manually refreshed by clicking <img src="https://mintcdn.com/kinetica/PHQlULcgtUSM8bYf/content/admin/images/refresh.png?fit=max&auto=format&n=PHQlULcgtUSM8bYf&q=85&s=8ea43eb0e37505cc79c64653d4b7cd39" alt="refresh" style={{display: "inline", margin: 0, verticalAlign: "middle"}} width="38" height="30" data-path="content/admin/images/refresh.png" />.

<img src="https://mintcdn.com/kinetica/1z8mB2CQRb2B9bKF/content/admin/images/udf_status.png?fit=max&auto=format&n=1z8mB2CQRb2B9bKF&q=85&s=01bf925cc9f23dc8cd9ec1de0b39dd02" alt="../../images/udf_status.png" width="897" height="133" data-path="content/admin/images/udf_status.png" />

To kill a stalled proc/tag, select the proc then click **Kill**.
Select **Run ID** or **Run Tag** to kill this proc
instance or all proc instances with the listed tag respectively. See
[/kill/proc](/content/api/rest/kill_proc_rest) for more information on run tags.

<img src="https://mintcdn.com/kinetica/1z8mB2CQRb2B9bKF/content/admin/images/udf_procs_kill.png?fit=max&auto=format&n=1z8mB2CQRb2B9bKF&q=85&s=c10af5d5b35a2d5a4c916a25e3b58aac" alt="../../images/udf_procs_kill.png" width="623" height="277" data-path="content/admin/images/udf_procs_kill.png" />

Once a proc has been completed or killed, you can clear out the status list
by clicking **Clear Completed**.

Click the **Run ID** to see a detailed status of the UDF execution
process.

<img src="https://mintcdn.com/kinetica/1z8mB2CQRb2B9bKF/content/admin/images/udf_detailed_status.png?fit=max&auto=format&n=1z8mB2CQRb2B9bKF&q=85&s=9c521e80fa083c2f36d57e1e84e31762" alt="../../images/udf_detailed_status.png" width="932" height="577" data-path="content/admin/images/udf_detailed_status.png" />
