<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/CustomStage/execute(items:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Spotlight",
      "FoundationModels"
    ],
    "preciseIdentifier" : "s:31_CoreSpotlight_FoundationModels11CustomStageP7execute5itemsAA18SearchPipelineDataVSay0aB014SearchableItemVG_tYaKF"
  },
  "title" : "execute(items:)"
}
-->

# execute(items:)

Generates output data from an array of searchable items from the app’s Spotlight index.

```
nonisolated(nonsending) func execute(items: [SearchableItem]) async throws -> SearchPipelineData
```

## Parameters

`items`

A set of [`CSSearchableItem`](/documentation/CoreSpotlight/CSSearchableItem) types.

## Return Value

A pipeline data structure with data your stage produced. Make sure the output you return matches the
output you specified in the [`outputType`](/documentation/CoreSpotlight/CustomStage/outputType) property.

## Discussion

If your stage supports searchable items as input, implement this method and use it to generate your stage’s supported output
data. Write your code to run in parallel with other instances of your stage and instances of other stages. The best approach
is to use only the contents of the `items` parameter and local intermediate values you create to deliver the output data.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)