# Get Workflow Inputs

Read what a run of the workflow takes, where the editor keeps it. A function (type function) answers its inputs, from its draft, with the draft's revision; steps read them as {{ function.inputs.<key> }}. Its workflow variables come in variables, in the shape a workflow's inputs have; steps read them as {{ workflow.inputs.<key> }}. Any other workflow (type workflow) answers its variables and, outside Embedded workflows, each one's value per environment id; steps read them as {{ workflow.inputs.<key> }}. issues lists what is kept as stored.

`GET https://connect.mindcloud.co/v2/workflows/:workflowId/inputs`

Permissions: `workflow:view`.

## Parameters

### Path

- `workflowId` (string, required): The workflow's id, from List Workflows.

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. A key can also act in its child organizations, and, with "Use this key across all of your organizations" on, in every organization its creator can open in the app. List them with GET /v2/companies. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

## Example request

```bash
curl --request GET \
  --url 'https://connect.mindcloud.co/v2/workflows/Wq3kZ8pLx2Nb/inputs' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN'
```

## Response fields

- `type` (string): function: a function's inputs, part of its draft (send its revision in If-Match to change them), and its workflow variables; workflow: the workflow's variables, with their value in each environment.
  Allowed values:
    - `function`
    - `workflow`
- `inputs` (array of objects): Every input, in order.
  - `key` (string): The name a step reads it by: {{ function.inputs.<key> }} or {{ workflow.inputs.<key> }}. Made from the label when left out, as the editor makes it; an array variable's ends in "[]". Absent only on an input kept as stored ({ $legacy, ref }).
  - `label` (string): The name the editor shows.
  - `type` (string): The data type: string, number, boolean, date, list (one of its choices), array, object, or file. Left out on a write: string.
    Allowed values:
      - `string`
      - `number`
      - `boolean`
      - `date`
      - `list`
      - `array`
      - `object`
      - `file`
  - `description` (string): Function inputs: what the input is for.
  - `testValue` (object): Function inputs: the value a run from the editor uses, as a step argument of the same type takes it (a template may use system, memory, workflow.inputs and integration.metadata).
  - `required` (boolean): Workflow variables (not boolean): every environment whose values change needs a value.
  - `errorMessage` (string): Workflow variables: the message shown when a value is refused.
  - `placeholder` (string): Workflow variables (not boolean): the hint in an empty field.
  - `sensitive` (boolean): Workflow string variables: masked in the editor; its values read as { $sensitive, ref } and are kept when sent back so.
  - `minLength` (number): Workflow string variables: the shortest value.
  - `maxLength` (number): Workflow string variables: the longest value.
  - `pattern` (string): Workflow string variables: a regular expression a value must match.
  - `numberType` (string): Workflow number variables: integer or decimal (the default).
    Allowed values:
      - `integer`
      - `decimal`
  - `min` (number): Workflow number variables: the smallest value.
  - `max` (number): Workflow number variables: the largest value.
  - `itemType` (string): Workflow list variables: the type of the choice values, string, number, boolean or date.
    Allowed values:
      - `string`
      - `number`
      - `boolean`
      - `date`
  - `choices` (array): Workflow list variables: the choices, in order. An app lookup list reads as { $legacy, ref }.
    - `value` (object): The value a run gets, typed as itemType.
    - `label` (string): What the editor shows.
  - `values` (object): Workflow variables outside Embedded workflows: the value in each environment, by environment id (List Environments). A run in an environment gets its value.
- `variables` (array of objects): Functions only: the function's workflow variables, in order, in the shape a workflow's inputs have (values per environment included); steps read them as {{ workflow.inputs.<key> }}. Live at once when changed, with no If-Match.
  - `key` (string): The name a step reads it by: {{ function.inputs.<key> }} or {{ workflow.inputs.<key> }}. Made from the label when left out, as the editor makes it; an array variable's ends in "[]". Absent only on an input kept as stored ({ $legacy, ref }).
  - `label` (string): The name the editor shows.
  - `type` (string): The data type: string, number, boolean, date, list (one of its choices), array, object, or file. Left out on a write: string.
    Allowed values:
      - `string`
      - `number`
      - `boolean`
      - `date`
      - `list`
      - `array`
      - `object`
      - `file`
  - `description` (string): Function inputs: what the input is for.
  - `testValue` (object): Function inputs: the value a run from the editor uses, as a step argument of the same type takes it (a template may use system, memory, workflow.inputs and integration.metadata).
  - `required` (boolean): Workflow variables (not boolean): every environment whose values change needs a value.
  - `errorMessage` (string): Workflow variables: the message shown when a value is refused.
  - `placeholder` (string): Workflow variables (not boolean): the hint in an empty field.
  - `sensitive` (boolean): Workflow string variables: masked in the editor; its values read as { $sensitive, ref } and are kept when sent back so.
  - `minLength` (number): Workflow string variables: the shortest value.
  - `maxLength` (number): Workflow string variables: the longest value.
  - `pattern` (string): Workflow string variables: a regular expression a value must match.
  - `numberType` (string): Workflow number variables: integer or decimal (the default).
    Allowed values:
      - `integer`
      - `decimal`
  - `min` (number): Workflow number variables: the smallest value.
  - `max` (number): Workflow number variables: the largest value.
  - `itemType` (string): Workflow list variables: the type of the choice values, string, number, boolean or date.
    Allowed values:
      - `string`
      - `number`
      - `boolean`
      - `date`
  - `choices` (array): Workflow list variables: the choices, in order. An app lookup list reads as { $legacy, ref }.
    - `value` (object): The value a run gets, typed as itemType.
    - `label` (string): What the editor shows.
  - `values` (object): Workflow variables outside Embedded workflows: the value in each environment, by environment id (List Environments). A run in an environment gets its value.
- `issues` (array of objects): Warnings about what is stored: values kept as stored, labels the editor no longer reads, duplicate keys.
  - `severity` (string): error refuses a write; warning does not.
    Allowed values:
      - `error`
      - `warning`
  - `code` (string): What is wrong, UPPER_SNAKE (LEGACY_VALUE_PRESERVED, LEGACY_LABEL, DUPLICATE_KEY, ...).
  - `path` (string): Where, as a JSON Pointer into the answer (/inputs/2/values/Ev4kR8mTq2Lx); empty for the whole list.
  - `message` (string): What is wrong, for a person.
- `revision` (string): Functions only: the draft's revision. Send it in If-Match on your next change to the draft.
