Articles on: AI Chatbot & Automations

How can I start a Chatbot scenario with no message sent from the user?

This guide will teach you how to start a chatbot scenario automatically, without users sending a message themselves.


In some cases, you might want to start a Bot scenario automatically before the user contacts you. For instance, to offer them buttons or ask some qualification questions.

This is possible programmatically by using our SDKs, which can easily be used. We'll demonstrate how in this quick guide.


Looking for a different way to start your scenario? Check out these guides as well:


🤖 If you're just getting started with our chatbot software, feel free to check out this guide to take you through your first steps.


Starting a Bot scenario automatically without a user sending a message requires using the Crisp SDKs. You can visit our Developer Hub to learn more about those.


Starting a Scenario by using the Javascript SDK


You can find the JS SDK method to trigger a Chatbot scenario directly in this documentation.


To trigger a Bot scenario directly with our Javascript SDK, you will simply need the ID of that scenario.

You can easily obtain it by click the *** menu next to that scenario, and hit the Copy Scenario ID button:


Once that ID is obtained, you can use it with our Javascript SDK on your website's code 🤖


Here is an example for a scenario with ID scenario_85c6438c-2310-4d2c-b4dc-c8f8a76d2d19:

$crisp.push(["do", "bot:scenario:run", ["scenario_85c6438c-2310-4d2c-b4dc-c8f8a76d2d19"]]);


Generally, you will want your scenario to start with an Action or Condition block when using this SDK method, so that it starts immediately. If your scenario begins with an Event block, your scenario will start but await for that even to occur in order to continue.


You can also combine it with our other SDK methods to fire your scenario when specific event occurred. Crisp provides some native callbacks which you can leverage in your code, here are a couple of examples:


  • When the chatbox is opened for the first time by the user
$crisp.push(["on", "chat:initiated", function() {
$crisp.push(["do", "bot:scenario:run", ["scenario_85c6438c-2310-4d2c-b4dc-c8f8a76d2d19"]]);
}]);


  • Anytime the chatbox is opened by the user
$crisp.push(["on", "chat:opened", function() {
$crisp.push(["do", "bot:scenario:run", ["scenario_85c6438c-2310-4d2c-b4dc-c8f8a76d2d19"]]);
}]);


You can of course configure your scenario with additional condition blocks at the beginning to further control when it should trigger. For instance with conditions such as Time Passed Since, Current Day/Hour or Conversation is New. You can read more about them in this in-depth guide.



Frequently Asked Questions


Still have some questions about the Bot that were not covered in this article or related guides? Perhaps you'll find the answer here!

Here are some of the most frequently asked questions about programmatically starting a Bot Scenario with the SDK.


Don't hesitate visiting this in-depth article to learn more about the Bot and master your craftsmanship of scenarios


If your question does not figure here, share it with us directly by chat, we'll be available!


I am using the SDK correctly but my Bot is not starting, why is that?


This can be troubleshooted by following a few steps.

  1. Ensure that your scenario was properly saved and deployed. You can also verify that it is enabled from the Scenario Manager view.
  2. Make sure that your using the correct Scenario ID as well (this is a common mistake).
  3. A scenario will not start if an operator has sent a message during the past 20 minutes, you can hover messages in that conversation to view the timestamps if you have any doubt. Also note that if you use a "Exit Block - Stop Scenario" at the end of your flow, it will prevent your scenario from triggering again during the next 24 hours, if it already ran once during this conversation.
  4. Finally, there could be an issue in your code, in the place where you are using the SDK to fire your scenario, make sure to follow good practices to easily debug your code.



I don't have access to the code of my website, is there any other way to use the SDK?


While using the SDK requires having access to the code of your website or application, you can also do with Google Tag Manager and similar tools if these are used on your website.

In GTM, you can create a "Custom HTML" tag to execute any SDK command, provided that Crisp is loaded on the page where you are injecting GTM. The Tags you create can be associated with a "Trigger" in order to determine how and when it should be executed.


For instance, to push a Crisp Event named "my-event" with GTM, you can create a "Custom HTML" Tag containing:

<script>
$crisp.push(["do", "bot:scenario:run", ["your-scenario_id"]]);
</script>



What else can I do with the SDK?


There are loads of possibilities with the SDK! You can programmatically open and close the chatbox, hide it, push custom data and segments, and much more. The SDK also allows you to listen to some events, in order to execute code when a user opens the chatbox, or when Crisp has loaded on your page.


You can read more about the SDK in our Developer's Hub, it provides a very useful set of tools!

Updated on: 07/09/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!