Magpai

Form Steps

Collect structured input from users to feed into your workflow.

Overview

Form steps pause the workflow to collect information from the user. The collected values become inputs that subsequent steps can use. Forms support various field types for different kinds of data.

Pro tip: Use default values for optional fields so the workflow can run unattended when needed.

Configuration

Form steps contain an array of input definitions:

PropertyTypeDescription
namestringField name (used as variable)
typestringInput type (see below)
valueanyCurrent value (set at runtime)
defaultValueany?Default if not provided
descriptionstring?Help text shown to user
optionsstring[]?Choices for select fields

Field Types

Choose the right field type for your data:

TypeInputUse Case
textText inputNames, descriptions, short text
numberNumeric inputQuantities, amounts, counts
booleanCheckbox/toggleYes/no decisions, flags
fileFile uploadDocuments, images, attachments
dateDate pickerDeadlines, events, dates
colorColor pickerBrand colors, design elements
urlURL inputLinks, endpoints, references
selectDropdownPredefined choices

Example Configuration

{
  "id": "step-1",
  "type": "form",
  "name": "Project Details",
  "inputs": [
    {
      "name": "projectName",
      "type": "text",
      "description": "Name of the project",
      "value": null
    },
    {
      "name": "priority",
      "type": "select",
      "description": "Project priority level",
      "options": ["Low", "Medium", "High", "Critical"],
      "defaultValue": "Medium",
      "value": null
    },
    {
      "name": "dueDate",
      "type": "date",
      "description": "Target completion date",
      "value": null
    },
    {
      "name": "includeAttachments",
      "type": "boolean",
      "description": "Include file attachments?",
      "defaultValue": false,
      "value": null
    },
    {
      "name": "attachments",
      "type": "file",
      "description": "Upload relevant files",
      "value": null
    }
  ]
}

Required vs Optional Fields

Fields without a defaultValue are required. The workflow will fail if these are not provided.

Required field (no default):

{ "name": "email", "type": "text", "value": null }

Optional field (has default):

{ "name": "format", "type": "select", "defaultValue": "PDF", "value": null }

Using Form Data in Subsequent Steps

Form inputs are automatically available to all following steps. Reference them in prompts by describing what data you need.

Prompt step after form:

"Using the project name and priority provided,
create a project brief. The due date is [dueDate]
and attachments are [if provided]."

The AI will have access to:
- projectName
- priority
- dueDate
- includeAttachments
- attachments (file reference)

Execution Behavior

  • Form steps always pause for user input (unless all fields have defaults)
  • Default values are used when running via API/webhook without interaction
  • File uploads are stored and accessible as URLs in subsequent steps
  • Empty required fields cause the workflow to fail with an error

Best Practices

  • Add descriptions to help users understand what each field expects
  • Use select fields when there are specific valid options
  • Set sensible defaults for optional fields
  • Group related inputs into a single form step
  • Keep form steps at the beginning of workflows when possible

Related