# AddStep

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`DistributedApplicationPipeline`](/reference/api/go/aspire.hosting/distributedapplicationpipeline.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Adds an application-level pipeline step in a TypeScript-friendly shape.

## Definition

```go
func (DistributedApplicationPipeline) AddStep(
    stepName string,
    callback func(arg PipelineStepContext),
    options ...*AddStepOptions,
) error
```

## Parameters

- `stepName` (`string`) -- The unique name of the pipeline step.
- `callback` (`func(arg PipelineStepContext)`) -- The callback to execute when the step runs.
- `options` (`...*AddStepOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*AddStepOptions` argument.

- `DependsOn` (`[]string`) -- Optional step names that this step depends on.
- `RequiredBy` (`[]string`) -- Optional step names that require this step.

## Returns

`error`

Returns `error`.

## Applies to

- [`DistributedApplicationPipeline`](/reference/api/go/aspire.hosting/distributedapplicationpipeline.md)
