You can give a custom python script in the Rest API app, which creates container in phantom. Here is the pseudo code:
# Acquire some container/artifact data to post
container = get_container()
artifacts = get_artifact_list_for_container(container)
# post your container
do_post_container(container)
# Set run_automation to false on all but the last one
for artifact in artifacts[:-1]:
artifact["run_automation"] = False
do_post_artifact(artifact)
do_post_artifact(artifacts[-1])
You can view this code at the last part of https://my.phantom.us/4.2/docs/rest/overview
... View more