You can set opt-in status or opt-out status through automation flow. 1. First, you need to open your flow and add an email step to your flow.
2. Click on the Edit email step, mark the Checkbox of edit email marketing and click on Edit email marketing and set the email which you want to opt in or Opt-out.
3. After adding the email address save the settings your process is complete.