i have found solutions where i can start list workflow on item knowking the workflow subscription ID using following lines
var wfServiceManager = SP.WorkflowServices.WorkflowServicesManager.newObject(context, web); var subscription = wfServiceManager.getWorkflowSubscriptionService().getSubscription(subID);
After loading the subscription object, wf can be started as follows
wfServiceManager.getWorkflowInstanceService().startWorkflowOnListItem(subscription, itemId, inputParameters);
This works just fine, the problem i ran into is, that while developing the workflow, its subscription id may change (depending on how you develope it - Visual Studio/Sharepoint designer/sideload/app catalog etc.). This means harcoding the subscription id is a risk - you have to remember that every deployment the subscription id may differ, not even speaking the id is always different on production and development environment.
The question is, is there a way to start workflow by its name or in some other way so that i don't have to hardcode the subscription id?
Thanks in advance