Can you please share syntax for triggering workflow action from server script in my custom app.
You can trigger a workflow action using the apply_workflow function by passing the Document object and the workflow action:
from frappe.model.workflow import apply_workflow
doc = frappe.get_doc("Purchase Order", "PO-0001")
apply_workflow(doc, "Approve")
You can call this inside your custom app (Python server-side code).
Note: If you are using the Server Script feature from UI, imports are not supported. In that case, you’ll need to expose a whitelisted method in your app and call it from the Server Script.