Is there a way to trigger a workflow (business process) using a task?

Which IIQ version are you inquiring about?

8.4

Please share any images or screenshots, if relevant.

Share all details about your problem, including any error messages you may have received.

I’m looking into a way to trigger a workflow periodically (once a day, for example).
The workflow is a custom workflow I’ve created.
I’m familiar with scheduled tasks but couldn’t find a relevant task type.
I’m also familiar with triggering a workflow using the SCIM rest API (scim/v2/LaunchedWorkflows), but I’m looking for something that can be done through the UI.

Interestingly, when I trigger a workflow using the rest API, a task with the type workflow is created, but this type doesn’t exist in the task type list.

@liza_s you can write run rule task and that task u can schedule, Please check the guide how to launch from rule

Hi @liza_s - You can launch a Workflow using a quicklink as well. Here is a basic snippet if you use a rule and a rule runner task to execute a workflow.

    String workflowName = "MyWorkflow"; // Change your workflow name
    String requestName = "Run '" + workflowName + "' for: " + identityName; // Change your request name
    String requesterId = "spadmin";
    Workflow eventWorkflow = context.getObject(Workflow.class, workflowName);
    Identity id = context.getObjectByName(Identity.class, requesterId);
    Attributes reqArgs = new Attributes();
    reqArgs.put(StandardWorkflowHandler.ARG_REQUEST_DEFINITION, WorkflowRequestExecutor.DEFINITION_NAME);
    reqArgs.put(StandardWorkflowHandler.ARG_WORKFLOW, workflowName);
    reqArgs.put(StandardWorkflowHandler.ARG_REQUEST_NAME, requestName);
    Attributes wfArgs = new Attributes();
    wfArgs.put("identityName", identityName);
    wfArgs.put("workflow", eventWorkflow.getName());
    reqArgs.putAll(wfArgs);
    Calendar calendar = Calendar.getInstance();
    calendar.add(Calendar.DAY_OF_MONTH, 0);
    Request req = new Request();
    RequestDefinition reqdef = context.getObject(RequestDefinition.class, "Workflow Request");
    req.setDefinition(reqdef);
    req.setOwner(id);
    req.setName(requestName);
    req.setEventDate(calendar.getTime());
    req.setAttributes( reqdef, reqArgs );
    RequestManager.addRequest(context, req);