Invocable method accept only single list as a parameter. We can pass multiple parameters to an invocable method using an inner class.
In this example, record triggered flow has been used.
public with sharing class invocableClass
{
@InvocableMethod(Label='Multiple Parameters')
public void passMultipleParameter(List<RequestClass> requestList)
{
//Example
List<String> accountIds = new List<String>();
for(RequestClass request: requestList)
{
accountIds.add(request.accountId);
}
//add your logic
}
public RequestClass
{
@InvocableVariable
public Id accountId;
@InvocableVariable
public Id contactId;
}
}