Agentforce Action Cannot Be Retrieved
Fix a branch sync that fails with RESOURCE_NOT_FOUND: We couldn't retrieve the action because an input or output schema is missing.
When a branch sync fails with an error like this one:
RETRIEVE_ERROR: Retrieve failed on the Salesforce side [Status: Failed] RESOURCE_NOT_FOUND: We couldn't retrieve the action "c__QueryRecords_1795785933a647d" because an input or output schema is missing. In the target org, remove references to the action from your agent, or recreate the action.
Salesforce is refusing to hand over an Agentforce agent because one of the actions it references no longer has a valid input/output schema. The error is raised by the Salesforce Metadata API itself, so any tool that retrieves the agent (Salesforce CLI, change sets, Blue Canvas) gets the same answer. Nothing in Blue Canvas is misconfigured and no permission change fixes it: the agent has to be repaired in Salesforce, or excluded from the sync until it is.
Why it happens
An agent action's schema is generated from the component the action wraps: an Apex invocable method, a Flow, or a prompt template. If that component is changed, deactivated or deleted after the action was created (for example, a deployment brought the agent across but not the Flow it depends on), Salesforce can no longer regenerate the schema and every retrieve of the agent fails. Because Blue Canvas retrieves metadata in groups, the whole sync fails until the org is fixed, and the branch shows the Agentforce Action Cannot Be Retrieved recommendation.
Fix the action in Salesforce (recommended)
- Note the action name in the error message (
c__QueryRecords_1795785933a647din the example above). In Salesforce, open the agent in Agentforce Studio and look for the action under its topics; Setup → Agentforce Assets → Actions lists all agent actions as well. - Check the component behind the action. An Apex class must compile with its invocable input and output types intact, a Flow must be active with valid input and output variables, and a prompt template must exist and be active.
- Once that component is healthy, recreate or re-map the action so Salesforce regenerates its schema. Regenerating the schema alone is not enough while the underlying component is broken.
- If the action is no longer needed, remove it from the agent's topic(s) instead.
- Back in Blue Canvas, trigger a sync on the branch. The recommendation clears once the next full sync completes.
Work around it in Blue Canvas
If repairing the agent will take a while, exclude it so the rest of the org keeps syncing:
- Exclude just the affected agent. Go to Settings → Metadata → Sync Rules and add a rule for
GenAiPlannerBundlethat excludes the agent by name. The branch's sync log lists the members of the failing retrieve, so you can find the agent's API name there. See Metadata Synchronization Rules. - Exclude all agents. Open the recommendation on the branch and click Stop tracking problematic types. This adds an exclusion rule for the agent type(s) that were in the failing retrieve.
Excluded metadata is removed from the repository (its git history remains) and cannot be deployed until the rule is removed again.
Several agent types
Depending on which group of metadata the failing retrieve contained, the recommendation may name
GenAiPlannerBundle(the agent),GenAiPlugin(a topic) orGenAiFunction(an action). Excluding the agent is usually enough.
Updated about 1 hour ago
