> For the complete documentation index, see [llms.txt](https://docs.ilert.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ilert.com/integrations/inbound-integrations/ibmcloudfunctions.md).

# IBM Cloud Functions Integration

Connect IBM Cloud Functions alerts to ilert to forward technical notifications for function failures and automate escalation to on‑call engineers.

IBM Cloud Function provides a service to run your application code without servers, scale it automatically, and pay nothing when it's not in use, with integrations with IBM Cloud services. Integrating IBM Cloud Functions with ilert enables technical alerts on execution failures or performance issues to reach on-call teams instantly. This ensures prompt attention to serverless function problems with clear escalation workflows and accountability.

{% hint style="warning" %}
IBM Cloud Functions is deprecated. Existing Functions entities such as actions, triggers, or sequences will continue to run, but as of **28 December 2023**, you can't create new Functions entities. Check [the official documentation](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-functions) for more details.
{% endhint %}

## In ilert: Create a IBM Cloud Functions alert source

1. Go to **Alerting** → **Alert sources** and click **Create new alert source**.
2. Search for **IBM Cloud Functions**, click its tile, and click **Next**.
3. Give your alert source a name, optionally assign teams, and click **Next**.
4. Choose who gets notified: select **Use existing escalation policy** and pick a policy, or **Generate new escalation policy** to start with a basic one that notifies you first. Click **Next**.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-8a281bf3931f5a1a531951ce97984d50989dd875%2Falert-source-escalation-step.png?alt=media" alt="The escalation step of the ilert alert source wizard, headed Who should be notified about alerts, with an escalation policy selected and a preview of its escalation rules below."><figcaption><p>Pick an existing escalation policy, or generate a basic one without leaving the wizard.</p></figcaption></figure>
5. Select **Default grouping** and click **Continue setup**. It groups events by the alert key the integration sets; the other [grouping options](/alerting/configure-alerting/alert-sources.md#event-grouping) are easier to judge once events are arriving.
6. The next page shows more settings, such as notification priority and alert templates. Click **Finish setup** for now; you can change them later.
7. On the final page, ilert shows the integration key and URL for this alert source. You will need them later in this guide.

## In IBM Cloud Functions

1. On IBM Cloud Functions dashboard, create an Action by clicking "**Actions**" -> "**Create**"

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FeQ5CqSH0lWosMljBvDAK%2Fibmcloud-createaction.png?alt=media\&token=3fabd1d2-16f6-40c8-9187-a24585aa716e)

2. Choose the name of your choice, in this case we will name it as "ilert-incidents", and choose "**Node.js 12**" as a runtime

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FN4ckgSb0vp9Il7fHxxVO%2Fibmcloud-functionaction.png?alt=media\&token=b942d57c-53ac-41a8-b76a-bfc2ed962bae)

3. Paste the following on the code, and please replace the "**ILERT\_URL**" with the **IBM Cloud Functions URL** that we got earlier on ilert's dashboard

```javascript
/**
  *
  * main() will be run when you invoke this action
  *
  * @param Cloud Functions actions accept a single parameter, which must be a JSON object.
  *
  * @return The output of this action, which must be a JSON object.
  *
  */
const request = require('request-promise');

function main(params) {

    if (!params.apiKey || !params.summary || !params.details) {
        throw new Error("params need to include 'apiKey', 'summary', and 'details'");
    }
    
    if (!params.eventType) {
        params.eventType = "ALERT";
    }

	console.log(`params: ${JSON.stringify(params)}`);

	// Set request options
	const options = {
		url: 'ILERT_URL',
		method: 'POST',
		json: true,
		body: params
	};

	// Make POST request
	return request(options)
	    .catch((error) => {
	        throw error;
	    });
}
```

4. To trigger it, we need to pass the params, in this case click on "**Invoke with parameters**" on top right

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2F2N3jLDNMBusQ9mv3A0IZ%2Fibmcloud-invokewithparams.png?alt=media\&token=adb5f7d2-ce43-448f-ac8d-bfb23bd47edf)

5. Put the following as a parameter, you can adjust the summary and details, however please replace the "**API\_KEY**" \*\*\*\* with the IBM Cloud Functions **API Key** that we go on ilert's dashboard earlier and **Apply** the parameters

```
{
    "apiKey":"API_KEY",
    "eventType": "ALERT",
    "summary": "Test IBM Function",
    "details": "Test IBM Function success"
}
```

6. To trigger the creation of incidents on ilert simple click "**Invoke**" on the top right, and it should create the incident on ilert

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2F4u7AieEZx4WUL0btuWTx%2Fibmcloud-invokesuccess.png?alt=media\&token=e377e020-040f-4b0c-b28d-d83bca9c56dd)

## FAQ

1. How to trigger the incident creation from other service?

   For more information about invoking from trigger in IBM Cloud Service, please refer to IBM Documentation: <https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-triggers>
2. Is it possible to manage the incident, for example to accept or resolve the incident?

   Yes it is possible if the `eventType` is passed with value `ACCEPT` or `RESOLVE`, this should accept and resolve the issue respectively. In addition to that, you need to pass the `incidentKey` parameter on creation as well. All the parameter on event creation will be accepted. For more information, please refer to our API Documentation: <https://api.ilert.com/api-docs/#tag/Events/paths/~1events/post>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ilert.com/integrations/inbound-integrations/ibmcloudfunctions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
