1.Site settings>>Manage site features>>Active Workflows can use app permissions
2. Site settings>>Site app permissions>> Copy the client section of the App Identifier(workflow). This is the identifier between the last "|" and the "@" sign, as shown in the figure.>>Go to the Grant permission to an app page. This must be done by browsing to the appinv.aspx page of the site.
Example: http://{hostname}/{the Site Collection}/_layouts/15/appinv.aspx >> Paste the client ID in the App Id field, and then select Lookup, as shown in the previous figure. >> Paste the following code in the Permission Request XML(below) field to grant full control permission
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
</AppPermissionRequests>
>>Create. >> Trust It.