Skip to Content
TutorialsHow to run a workflow to check a Lightning Invoice

How to run a workflow to check a Lightning Invoice

This tutorial will take you through running a workflow to check a Lightning Invoice for compliance and risk issues.

You need to have an API key for this tutorial. Check how to authenticate your API calls here.

Template

Reflex provides a template for running checks against an invoice.

Template ID: 37d9923d-25fd-46fd-a0d3-3997dab9bff0

Custom templates are only available to enterprise users. Please reach out if you need access to custom templating features.

Running the workflow

For this workflow we are going to be running checks against the following invoice, passing a webhook URL to get notified of the result of the workflow and an email address to get the workflow report if it fails.

Invoice: lnbc1500u1pn668g9pp5d4mgwnmzmwzzq2jxus3v7g9jhwln52rvsv7dxrn6rmunden7hxasdqqcqzzsxqyz5vqsp5aegsttsfar2xf8cfctn6lne3dquvfq4cp28h80flep4d4d8kceyq9p4gqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqysgqdxz6k8634nshccx8ckrykrnlf5aktrekhnqm4dyr69rzwhvx08gxw5svm9uq8agt6y3dpq5sv56v8cxfpkvp258pjgg33p589dxsvpgqszs4yh

Query

mutation Create($input: WorkflowRunInput!) { workflows { runs { create(input: $input) { workflow_run_id } } } }

Variables

{ "input": { "template_id": "37d9923d-25fd-46fd-a0d3-3997dab9bff0", "webhook_url": "https://webhookendpoint.com", "workflow_input": [ { "name": "PAYMENT_REQUEST", "value": "lnbc1500u1pn668g9pp5d4mgwnmzmwzzq2jxus3v7g9jhwln52rvsv7dxrn6rmunden7hxasdqqcqzzsxqyz5vqsp5aegsttsfar2xf8cfctn6lne3dquvfq4cp28h80flep4d4d8kceyq9p4gqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqysgqdxz6k8634nshccx8ckrykrnlf5aktrekhnqm4dyr69rzwhvx08gxw5svm9uq8agt6y3dpq5sv56v8cxfpkvp258pjgg33p589dxsvpgqszs4yh" } ], "notification_settings": { "emails": [ { "email": "[email protected]" } ], "trigger": { "type": "STATUS", "status": "FAILURE" } } } }

Result

Once we start the workflow we will get the workflow_run_id. With this ID you can query the API to get additional information about the run.

{ "data": { "workflows": { "runs": { "create": { "workflow_run_id": "02b060cc-fc05-485d-8ebc-926ec13a82b6" } } } } }

UI

You can also see the result of the workflow in our dashboard.

Invoice Check Workflow

Last updated on