To register the workflow in CRM Online follow below steps:
Open the Visual Studio; go to File → New Project → Dynamics CRM → Dynamics CRM 2011 Package and Click Ok.
After that Connect to Dynamics CRM Server
On click of Ok button the package will open then add a new project to this package. Right click on solution → Add → New Project.
The below window will be pop up to select the project type. Select Dynamics CRM 2011 Workflow Library, give the project name and click Ok.
Once the project is loaded add a Class file for the workflow. To do this right click on project click “Add New Item”.
Select the Class type as Workflow Activity Class. This will generate the Class with the Execute method
You can implement your logic indicated by // TODO: as given in the below screen shot.
Once the logic has been implemented double click on “RegisterFile.crmregister” see below screen.
This will open the below file, here change the IsolationMode to “Sandbox”.
Build the solution and deploy. After that go to CRM and create a Workflow as per your requirement and add the Custom workflow assembly to this workflow as shown in below screen shot.
Possible Errors during deploying the package:
All the above information are required, if you miss any of the above information you may get an error “Error registering plugins and/or workflows. [Parameter Name] name must be specified Parameter name: [Parameter Name]”