# Parameters - Getting Started Examples

> Demonstrates how to work with procedure parameters (inputs) and use them throughout your workflow. This example shows: - Defining input schemas with descriptions and default values - Accessing input parameters within the procedure function - Using parameters in loops and logic - Logging with the Lo…

Canonical: https://tactus.anth.us/examples/getting-started/parameters/

::band{columns="document-hero wide"}

[Examples](/examples/) / [Getting Started](/examples/getting-started/) / Parameters

# Parameters

- Has Specs

Demonstrates how to work with procedure parameters (inputs) and use them throughout your workflow. This example shows: - Defining input schemas with descriptions and default values - Accessing input parameters within the procedure function - Using parameters in loops and logic - Logging with the Log utility - State management with \`State.increment()\` - Returning structured output that references input parameters

::band{tone="muted" columns="example"}

## Source Code

```lua
-- Parameters Example
-- Demonstrates accessing parameters and using them in procedure logic

-- No agents are needed for this example.

-- Procedure with input and output defined inline
Procedure {
    input = {
        task = field.string{description = "The task name to process", default = "default task"},
        count = field.number{description = "Number of iterations to perform", default = 3},
    },
    output = {
        result = field.string{required = true, description = "Summary of the completed work"},
    },
    function(input)
        -- Access input
        local task = input.task
        local count = input.count

        Log.info("Running task", {task = task, count = count})

        -- Use parameters in workflow
        state.iterations = 0
        for i = 1, count do
          State.increment("iterations")
          Log.info("Iteration", {number = i, task = task})
        end

        local final_iterations = state.iterations

        return {
          result = "Completed " .. task .. " with " .. final_iterations .. " iterations"
        }
    end
}

-- BDD Specifications
Specification([[
Feature: Parameter Usage
  Demonstrate parameter access and usage in workflows

  Scenario: Parameters are used correctly
    Given the procedure has started
    When the procedure runs
    Then the procedure should complete successfully
    And the state iterations should be 3
    And the output result should exist
]])
```

## Quick Start

Run the example:

```bash
tactus run 01-getting-started/03-parameters.tac
```

Test with mocks:

```bash
tactus test 01-getting-started/03-parameters.tac --mock
```

[View source on GitHub →](https://github.com/AnthusAI/Tactus-examples/blob/main/01-getting-started/03-parameters.tac)

::band{columns="neighbors"}

- [*← Previous Example* **Simple Logic**](/examples/getting-started/simple-logic/)
- [*Next Example →* **Simple Agent**](/examples/getting-started/simple-agent/)

::band{columns="cta"}

## Explore more examples

Learn Tactus through practical, runnable examples organized by topic.

::button{href="/examples/" label="View All Examples" size="lg"}
