# transformSteps (/docs/api/functions/transformSteps)



```ts
function transformSteps(
   ctx, 
   jobId, 
   job, 
   fn): void;
```

Defined in: [packages/core/src/ir.ts:265](https://github.com/austenstone/actio/blob/2b01e694a0f76521d8c073f3c6a2e48917d2c9d9/packages/core/src/ir.ts#L265)

Rebuild a job's `steps` in place: `fn` returns the replacement step(s) for
each input step, so a pass can fan one step out into many (retry attempts,
fallback notify steps) while keeping the surrounding steps untouched. Each
original step's origin is recorded before `fn` runs so replacements built
with `cloneNode`/`deriveNode` inherit it.

## Parameters [#parameters]

### ctx [#ctx]

[`ParseContext`](../interfaces/ParseContext.mdx)

### jobId [#jobid]

`string`

### job [#job]

[`Job`](../interfaces/Job.mdx)

### fn [#fn]

(`step`, `index`) => [`Step`](../interfaces/Step.mdx)\[]

## Returns [#returns]

`void`


## Sitemap

Browse the full documentation: [Markdown sitemap](https://austenstone.github.io/actio/sitemap.md) · [XML sitemap](https://austenstone.github.io/actio/sitemap.xml)