<!--
{
  "availability" : [
    "macCatalyst: 14.0.0 -",
    "macOS: 10.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Automator",
  "identifier" : "/documentation/Automator/AMWorkflowControllerDelegate/workflowController(_:didError:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Automator"
    ],
    "preciseIdentifier" : "c:objc(pl)AMWorkflowControllerDelegate(im)workflowController:didError:"
  },
  "title" : "workflowController(_:didError:)"
}
-->

# workflowController(_:didError:)

Notifies the delegate when the workflow encounters an error.

```
optional func workflowController(_ controller: AMWorkflowController, didError error: any Error)
```

## Parameters

`controller`

The controller object sending the message.

`error`

If a workflow error occurs, upon return contains an instance of <doc://com.apple.documentation/documentation/Foundation/NSError> that describes the problem.

---

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)