> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# addPomAsSubsection

> Append another PomBuilder's sections as subsections of a target section.

[ref-findsection]: /docs/server-sdks/reference/typescript/agents/pom-builder/find-section

Append every top-level section of another `PomBuilder` as a subsection of a
target section in this builder. Useful for composing prompts assembled
separately into a single document.

<Warning>
  Throws `Error("No section with title '<target>' found.")` when `target` is a
  string and no section with that title exists. For deeper lookups, resolve the
  section yourself via [`findSection()`][ref-findsection] and pass the
  `PomSection` directly.
</Warning>

## **Parameters**

<ParamField path="target" type="string | PomSection" required={true} toc={true}>
  The target section to append into. Pass a title string for top-level
  sections, or a `PomSection` instance (from `findSection()`) for nested
  sections.
</ParamField>

<ParamField path="pomToAdd" type="PomBuilder" required={true} toc={true}>
  The builder whose sections should be appended.
</ParamField>

## **Returns**

`this` -- returns the builder for fluent chaining.

## **Example**

```typescript {11}
import { PomBuilder } from '@signalwire/sdk';

const subPom = new PomBuilder();
subPom.addSection('Policy A', { body: 'Always greet by name.' });
subPom.addSection('Policy B', { body: 'Escalate billing issues.' });

const main = new PomBuilder();
main.addSection('Introduction', { body: 'You are a helpful agent.' });
main.addSection('Policies');

main.addPomAsSubsection('Policies', subPom);
console.log(main.renderMarkdown());
```