Building integrations

How do I auto-approve a process item with an integration?

Use the Approve an item action with the item's instance ID and current activity instance ID, and make the connection owner an assignee of that step.

How-to

Short answer: Use the Kissflow Process action Approve an item. Map the item's instance ID and the activity instance ID of its current step, and add the connection owner as an assignee of that step.

Why it happens

  • Approve an item needs two IDs. The instance ID identifies the item. The activity instance ID identifies the step the item is on now, so it changes at every step.
  • The action runs as the connection owner. If that account isn't an approver of the step, the run fails with errors such as "item moved out of your queue" or "no permission".

How to fix it

  1. Create an integration with the Kissflow Process trigger When an item enters this step, set to the step you want to approve.
  2. Add the action Approve an item.
  3. Map the instance ID to the item's _id. Map the activity instance ID to the _id of the first entry in _current_context, not to the step name.
  4. Add the connection owner, or a service account, as an assignee of that workflow step.
  5. Test with a real item that is in progress at that step: copy its instance ID and activity instance ID into the action, run the test, then map the dynamic fields back and turn on the integration.

When the item to approve isn't the trigger item, for example when a board item reaches Done:

  1. Add a condition that checks the status.
  2. Add Search an item on the target process to get its instance ID and current activity instance ID. It returns up to 100 items.
  3. Map both values into Approve an item.

For parallel branches, _current_context holds one entry per branch. Iterate over it and map the value from the iteration.

To approve through the REST API, call Submit a process item with the instance ID and activity instance ID. See API and SDK documentation. Use the access key of a step assignee, for example a service account assigned to that step.

Tip

For a clean audit trail, have the approver authenticate the action with their own account after an admin builds the integration.

Related answers