First of all, the OCR process is a resource intense process, so it is not recommended that it be done from your main production Workflow Server. So set up a new Workflow Server to run the OCR workflow.
That said...
Add reference for Laserfiche.DocumentServices and add the using statement at the top of the code.

Then in your Execute code block:
protected override void Execute()
{
// Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
string sError = "None";
try
{
// Retrieves a document to be processed with OCR.
if ((BoundEntryInfo.EntryType == EntryType.Document))
{
using (DocumentInfo Doc = (DocumentInfo)BoundEntryInfo)
{
Doc.Lock(LockType.Exclusive);
// Instantiates a new OCR engine.
using (OcrEngine ocr = OcrEngine.LoadEngine())
{
// configure OCR options
ocr.AutoOrient = true;
ocr.Decolumnize = true;
ocr.OptimizationMode = OcrOptimizationMode.Accuracy;
// Generate text for all pages of the given document
PageSet ps = Doc.AllPages;
ocr.Run(Doc, ps);
}
// unlock the document
Doc.Unlock();
}
}
}
catch (Exception ex)
{
sError = ex.Message;
WorkflowApi.TrackError(ex.Message);
}
SetTokenValue("Script_Error", sError);
}