Log inStart Free Trial
Meta Tech Provider

WhatsApp AI after hours: your AI replies at night, a person during the day

To have AI answer WhatsApp customers only while you are closed, create an automation with the After hours trigger and a Reply with AI step. Set your open days, opening and closing times and timezone. Outside them, your AI model answers from your instructions and says when a person is back. During opening hours it stays quiet, and you answer from the WhatsApp Business app.

easyCoexistence runs the night shift on the WhatsApp Business number you keep in the app, through Meta's Cloud API and Coexistence, with your own AI key and no charge for AI or automations.

After hours

The match that runs only while you are closed, judged by Open on days, From and To, and an IANA timezone.

3rd of 4

After hours ranks below keyword and First message automations and above the Every message catch-all.

4 hours

Default pause on a chat after you reply from the phone, so a conversation open at closing time stays with you.

10 per hour

Default cap on AI replies per chat in one hour, adjustable from 1 to 60.

24 hours

Free-form replies, AI ones included, go out only within 24 hours of the customer's last message.

How does an after-hours AI work on WhatsApp?

One automation does it. Its trigger is "A message arrives" with the After hours match, described in the editor as "When a message arrives while you are closed.", and its step is Reply with AI, "Your AI writes the reply". When a customer writes outside your opening hours, the step sends your Instructions and the last messages of the chat to the model you picked, on your own Anthropic, OpenAI or OpenRouter key, and sends the answer back on the same chat. The reply appears in the WhatsApp Business app on your phone like any message from the business. Inside opening hours the trigger does not match, so the automation does nothing and the message waits for you in the app.

1Customer writes at 22:40To the number you keep in the app
2After hours matchesClosed by your Open on days, From and To
3Your AI answersInstructions plus recent messages, on your key
4Morning: you read the chatThe AI's replies sit in the app's thread
5You reply from the phoneThe AI stays out of that chat for 4 hours

How do you set the hours of the AI's shift?

Think of the opening hours as the AI's time off. Under Open on, tick the days you open; set From and To; and set the Timezone to a city name such as America/Sao_Paulo or Europe/Madrid, since the editor refuses a name it does not know. The AI then covers three kinds of time:

  • Evenings and early mornings on open days: anything before From or after To.
  • Whole days left unticked, such as Sunday: the AI answers around the clock on them.
  • Overnight openings: a bar open 18:00 to 02:00 sets From 18:00 and To 02:00, and the AI covers 02:00 to 18:00.
  • A lunch break: add a second After hours automation, every day ticked, From 13:00 To 12:00. It reads as closed only from 12:00 to 13:00.

What should the night instructions say?

Five things: that the business is closed and when it opens, what the AI may answer, what it must leave for a person, which details to collect for the morning, and how long a reply should be. The Instructions field takes up to 20,000 characters and the same variables as a text reply, so {{first_name}} works there too. Under your text, easyCoexistence adds five rules of its own: write a short plain chat message in the customer's language, say a person will answer when the customer asks for one or the AI cannot help, never invent prices, stock, dates or policies, and say it is the business's automated assistant when asked. The first reply after a quiet day also opens by saying so. Your instructions should make that hand-off concrete by naming the opening time.

Instructions for a Reply with AI step on an After hours automation
You answer WhatsApp messages for Bloom Café while we are closed.
We open Monday to Saturday, 8:00 to 18:00 (São Paulo time).

You may answer: the menu and prices below, delivery areas
(up to 5 km), opening hours, and how to order.

You may not confirm orders, table bookings, refunds or discounts.
For those, collect the customer's name, what they want and when,
and say: "A person from Bloom confirms this after 8:00."

Menu and prices: [paste here]

Keep replies to two or three short lines. No lists.

What happens at closing time and in the morning?

At closing time, chats you are still in stay yours. If you answered a customer at 17:50 and they write again at 18:05, the after-hours run is Skipped with "You answered this chat from your phone recently", because a reply from the phone pauses the automation on that chat for 4 hours by default. Other chats get the AI as soon as the clock passes To. In the morning, open the app or Conversations in the dashboard: every chat the AI handled shows its replies in the thread, so you read what was promised before you write. A customer who writes after From gets no automatic reply and waits for you. To get a list of the night's chats outside the app, add Call my webhook after the AI step pointing at your system or n8n, and return no reply, so nothing extra is sent.

Which other automations take night messages first?

Only one automation answers an incoming message, so check what else is on the number before you rely on the AI at night:

  • Keyword automations rank first, at any hour. A customer who writes "price" at midnight gets your fixed price text, which keeps figures exact.
  • First message ranks above After hours. A new customer at night gets the welcome, so add Reply with AI after the greeting, or drop the welcome.
  • An Every message automation would answer during the day too. For a person by day, keep the AI only on the After hours automation.
  • The app's own away message still fires from the phone. Turn it off in the Tools tab, or customers get two night replies.

Can your AI set it up for you?

Yes, through the easyCoexistence connector in ChatGPT or Claude. Say when you open, in which city, and what the AI may and may not do at night. The assistant calls list_numbers, then create_automation with an outside_hours trigger and an ai_reply step, then test_automation on a sample message, which sends nothing to anyone. The one-minute Wait lets a customer who sends three lines in a row get one answer: each new message that starts this automation replaces the run still waiting. The AI key itself is never pasted in a chat; it is saved once under AI keys in the dashboard.

The request, and the create_automation call it becomes
You: On my WhatsApp number, let my AI answer only while we're
     closed. We open Monday to Friday, 9:00 to 19:00, Madrid time.
     It must not confirm bookings; a person does that after 9:00.

→ create_automation {
    "connection_id": "…from list_numbers…",
    "name": "Night shift: AI",
    "trigger": {
      "type": "message_received",
      "match": "outside_hours",
      "hours": {
        "timezone": "Europe/Madrid",
        "days": [1, 2, 3, 4, 5],
        "start": "09:00",
        "end": "19:00"
      }
    },
    "steps": [
      { "type": "wait", "minutes": 1 },
      {
        "type": "ai_reply",
        "provider": "anthropic",
        "model": "<a model id from your key's list>",
        "prompt": "We are closed and open at 9:00 Madrid time. …",
        "history": 6,
        "max_tokens": 300
      }
    ],
    "settings": { "takeover_hours": 6, "ai_max_per_hour": 10 }
  }
→ test_automation { "automation_id": "…", "text": "Can I book for Friday?" }

What does a night shift cost?

Three separate bills, none of them per automation. Your AI provider charges your own key for the tokens of night replies only, since nothing runs during opening hours; a short Longest reply (tokens) and fewer Earlier messages it reads keep each reply small. Meta gives each number 1,000 free service messages a month and bills further messages and templates to your own WhatsApp Business Account, by category and country, and easyCoexistence never marks them up. easyCoexistence charges per connected number, from US$ 9 a month for up to 5 numbers down to US$ 0.75 a month past 2,000, with automations and AI replies included and no run cap.

How to set it up

  1. Save your AI keyOn the Automations page, click AI keys, pick Anthropic, OpenAI or OpenRouter, paste the key and click Test and save.
  2. Start from the Away message exampleClick New automation, then Use this on Away message, which already has the After hours match and your opening days. Delete its Reply with text step and add a Reply with AI step with the + under Say something.
  3. Set the shiftTick the days you open under Open on, set From and To, and check the Timezone is your city.
  4. Write the night instructionsIn the Reply with AI step, pick the Model and write the Instructions: closed until when, what to answer, what to leave for a person.
  5. Test it switched offSwitch it Off, click Save, then Run test with a night question. Nothing is sent. Switch it On and click Save.
  6. Turn off the app's away messageOn the phone, open Tools, tap Away message and turn off Send away message.

Common mistakes

  • Leaving another AI automation on Every message running beside the night one. It answers during opening hours too, so the person-by-day half of the pattern disappears.
  • Letting the AI say "Your table is booked". It has no access to your calendar; tell it to collect the details and say a person confirms after opening.
  • Testing by writing to the number during opening hours. The trigger does not match then, so nothing comes back; Run test runs the steps without checking the clock.
  • Setting the pause to 0. The AI then answers right after your last reply of the day, on a chat you were still handling.
Doing this with EasyCoexistence

Build it in the editor or ask ChatGPT or Claude through the connector; a reply from your phone pauses it on that chat. US$ 9 down to US$ 0.75 per number per month, falling as you add numbers, with the first 3 days free.

easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.

Frequently asked questions

Will the AI tell customers it is an AI?

Yes, without being told. The first AI reply to a customer after a day without one opens by saying it is the business's automated assistant (a short "(Automated assistant)" label is added if the model leaves it out), and the model says so whenever it is asked. Your instructions can add the name, such as "Introduce yourself as Bloom's virtual assistant".

What if customers send voice notes at night?

With an OpenAI or OpenRouter key of your own, a voice note is written out and the AI receives "[voice message]" followed by the words; without one, or when the recording is too long, it stays "[voice message]" alone. Photos arrive as "[image]" plus any caption. Add a line to the Instructions: ask the customer to type the question, or say a person will listen to it after opening.

Does my phone need to stay on at night?

No. The automation runs on a server through Meta's Cloud API, so the phone can be off. Open the WhatsApp Business app at least every few days, though: Meta disconnects a Coexistence number whose app goes about 14 days without use.

Can the AI cover nights and a person cover weekends?

Yes, by ticking the weekend days under Open on even though you are closed, so the trigger treats them as open. Messages on weekend nights then reach the AI only outside From and To, and the daytime ones wait for you in the app.

Keep reading

Ready to get started?

Set up WhatsApp Coexistence in minutes, not months. The app keeps working on the phone.

Start Free Trial

Verified on