> ## 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.

# /execute/proc

```
URL: http://<db.host>:<db.port>/execute/proc
```

Executes a proc. This endpoint is asynchronous and does not wait for the proc
to complete before returning.

If the proc being executed is distributed, input parameter *input\_table\_names*
and input parameter *input\_column\_names* may be passed to the proc to use for
reading data, and input parameter *output\_table\_names* may be passed to the
proc to use for writing data.

If the proc being executed is non-distributed, these table parameters will be
ignored.

## Input Parameter Description

<ParamField body="proc_name" type="string">
  Name of the proc to execute. Must be the name of a currently existing proc.
</ParamField>

<ParamField body="params" type="map of string to strings">
  A map containing named parameters to pass to the proc. Each key/value pair specifies the name of a parameter and its value.

  The default value is an empty map ( \{} ).
</ParamField>

<ParamField body="bin_params" type="map of string to bytes">
  A map containing named binary parameters to pass to the proc. Each key/value pair specifies the name of a parameter and its value.

  The default value is an empty map ( \{} ).
</ParamField>

<ParamField body="input_table_names" type="array of strings">
  Names of the tables containing data to be passed to the proc. Each name specified must be the name of a currently existing table, in \[schema\_name.]table\_name format, using standard [name resolution rules](../../concepts/tables/#table-name-resolution). If no table names are specified, no data will be passed to the proc.  This parameter is ignored if the proc has a non-distributed execution mode.

  The default value is an empty array ( \[] ).
</ParamField>

<ParamField body="input_column_names" type="map of string to arrays of strings">
  Map of table names from input parameter *input\_table\_names* to lists of names of columns from those tables that will be passed to the proc. Each column name specified must be the name of an existing column in the corresponding table. If a table name from input parameter *input\_table\_names* is not included, all columns from that table will be passed to the proc.  This parameter is ignored if the proc has a non-distributed execution mode.

  The default value is an empty map ( \{} ).
</ParamField>

<ParamField body="output_table_names" type="array of strings">
  Names of the tables to which output data from the proc will be written, each in \[schema\_name.]table\_name format, using standard [name resolution rules](../../concepts/tables/#table-name-resolution) and meeting [table naming criteria](../../concepts/tables/#table-naming-criteria). If a specified table does not exist, it will automatically be created with the same schema as the corresponding table (by order) from input parameter *input\_table\_names*, excluding any primary and shard keys. If a specified table is a non-persistent result table, it must not have primary or shard keys. If no table names are specified, no output data can be returned from the proc. This parameter is ignored if the proc has a non-distributed execution mode.

  The default value is an empty array ( \[] ).
</ParamField>

<ParamField body="options" type="map of string to strings">
  Optional parameters.

  The default value is an empty map ( \{} ).

  <Expandable title="options">
    <ParamField body="cache_input">
      No longer supported; option will be ignored.

      The default value is ''.
    </ParamField>

    <ParamField body="use_cached_input">
      No longer supported; option will be ignored.

      The default value is ''.
    </ParamField>

    <ParamField body="run_tag">
      A string that, if not empty, can be used in subsequent calls to [/show/proc/status](/content/api/rest/show_proc_status_rest) or [/kill/proc](/content/api/rest/kill_proc_rest) to identify the proc instance.

      The default value is ''.
    </ParamField>

    <ParamField body="max_output_lines">
      The maximum number of lines of output from stdout and stderr to return via [/show/proc/status](/content/api/rest/show_proc_status_rest). If the number of lines output exceeds the maximum, earlier lines are discarded.

      The default value is `100`.
    </ParamField>

    <ParamField body="execute_at_startup">
      If *true*, an instance of the proc will run when the database is started instead of running immediately. The output parameter *run\_id* can be retrieved using [/show/proc](/content/api/rest/show_proc_rest) and used in [/show/proc/status](/content/api/rest/show_proc_status_rest).

      The default value is `false`.

      The supported values are:

      * true
      * false
    </ParamField>

    <ParamField body="execute_at_startup_as">
      Sets the alternate user name to execute this proc instance as when *execute\_at\_startup* is *true*.

      The default value is ''.
    </ParamField>
  </Expandable>
</ParamField>

## Output Parameter Description

The Kinetica server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query.  Here is a description of the various fields of the wrapper:

<ResponseField name="status" type="String">
  'OK' or 'ERROR'
</ResponseField>

<ResponseField name="message" type="String">
  Empty if success or an error message
</ResponseField>

<ResponseField name="data_type" type="String">
  'execute\_proc\_response' or 'none' in case of an error
</ResponseField>

<ResponseField name="data" type="String">
  Empty string
</ResponseField>

<ResponseField name="data_str" type="JSON or String">
  This embedded JSON represents the result of the /execute/proc endpoint:

  <Expandable title="data_str">
    <ResponseField name="run_id" type="string">
      The run ID of the running proc instance. This may be passed to [/show/proc/status](/content/api/rest/show_proc_status_rest) to obtain status information, or [/kill/proc](/content/api/rest/kill_proc_rest) to kill the proc instance.
    </ResponseField>

    <ResponseField name="info" type="map of string to strings">
      Additional information.
    </ResponseField>
  </Expandable>

  Empty string in case of an error.
</ResponseField>
