The invention discloses a workflow unloading optimization algorithm in a mobile edge environment, comprising the following steps: step S1, constructing a workflow scheduling model under the mobile edge environment; step S2, accord to that topology structure, searching a critical path base on the local calculation amount of the workflow, respectively storing nodes and remaining node on the criticalpath into a key node queue and a remaining node queue and waiting for scheduling; step S3, after that eNB node is abstracted into a topology structure, accord to a user history moving path and combining with a prediction model, obtaining a qualified eNB set, and accord to the prediction probability, selecting an optimal unloadable eNB according to the prediction speed and the prediction direction, and providing the eNB to a user for performing task unloading; step S4, dynamically dividing that tasks accord to the scheduling strategy into local execution or unloading to the edge side for execution, and dynamically updating the critical path during the scheduling process; step S5, according to the scheduling result, assigning tasks to the devices under the mobile edge environment until thescheduling of the entire workflow is completed.