
# Run unattended and scheduled tasks

Personal sign-in is for a person at the keyboard. Anything that runs on its own (a morning health check, a nightly data pull, a weekly report) uses a **service credential** instead, so it keeps working when nobody is around to click a sign-in link.

## The setup-code flow (recommended)

You never handle a secret. The flow is built around a one-time code:

1. Your MixShift admin mints a **setup code** from the admin page and sends it to you. The code is single use and expires in ten minutes, so it is safe to paste in chat.
2. In a chat, say **"set up a service credential"** and paste the code when asked.
3. The plugin exchanges the code itself; the credential lands directly on the machine that will run the work.

If you are the admin, ask us and we will point you at the minting page for your account.

## Let the skill build the whole task

Say **"set up a scheduled mixshift task"** (or run `/mixshift-ai:mx-scheduled-task`). It owns the full lifecycle so the task survives restarts and fresh sessions:

- picks a durable folder the task can always find again,
- sets up the service credential inside it,
- generates task instructions that re-find the credential and re-pull brand context at the start of every run,
- verifies the first run end to end before calling it done.

## Good to know

- Service credentials are read-only by default. If an unattended job should be able to change things in your ad account, that permission is granted explicitly when the credential is minted, and every change is still audited.
- Scheduled analytical skills need brand context, and the generated task pulls it from your organization store on each run. Set the brand up once first: [Set up a brand](/knowledge-base/plugin/how-to/set-up-a-brand).

## If a scheduled task breaks

A task reporting **"not signed in"**, **"no credentials found"**, or **"missing brand context"** is the fix-it case for the same skill: say "repair my scheduled mixshift task" and it re-anchors the credential and context.

## Related

- [Sign in to MixShift](/knowledge-base/plugin/getting-started/sign-in) (interactive sign-in)
- [Set up a brand](/knowledge-base/plugin/how-to/set-up-a-brand)