This error arises on the deployment of a SharePoint Workflow where the developer has put an activity above the onWorkflowActivated activity.
Kindly, put the onWorkflowActivated activity as the first activity in your workflow as this is a SharePoint restriction.
Try to deploy again. Good luck!