I tried to do it inside the function but it wasn't executed.
def function():
# execution of function
if condition:
# create one more process
if __name__ == "__main__":
with concurrent.futures.ProcessPoolExecutor() as executor:
res = [list of processes]