# Is that possible to send signal to a temporal workflow through REST api?

**URL:** <https://community.temporal.io/t/is-that-possible-to-send-signal-to-a-temporal-workflow-through-rest-api/7953>\
**Category:** Community Support\
**Tags:** general-impl\
**Created:** [April 18, 2023, 1:40am UTC](https://community.temporal.io/t/is-that-possible-to-send-signal-to-a-temporal-workflow-through-rest-api/7953 "2023-04-18T01:40:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Zhao](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chris_zhao/32/3641_2.png) [@Chris\_Zhao](https://community.temporal.io/u/Chris_Zhao)\
**Post date:** [April 18, 2023, 1:40am UTC](https://community.temporal.io/t/is-that-possible-to-send-signal-to-a-temporal-workflow-through-rest-api/7953/1 "2023-04-18T01:40:29Z")

</div>

Say we start the workflow in service A and at some point we’d like to block the workflow and only continue when we receive a signal from service B. Is that possible to do it through REST api instead of using client? Thanks!

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [April 18, 2023, 7:59pm UTC](https://community.temporal.io/t/is-that-possible-to-send-signal-to-a-temporal-workflow-through-rest-api/7953/3 "2023-04-18T19:59:32Z")

</div>

I assume rest api is exposed from service B? It’s not uncommon to have rest api endpoints which use temporal sdk client apis to start / signal executions. If you provide more info on use case we could possibly give more details.

---

<div class="post-metadata">

**Author:** ![Chris\_Zhao](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chris_zhao/32/3641_2.png) [@Chris\_Zhao](https://community.temporal.io/u/Chris_Zhao)\
**Post date:** [April 18, 2023, 11:17pm UTC](https://community.temporal.io/t/is-that-possible-to-send-signal-to-a-temporal-workflow-through-rest-api/7953/5 "2023-04-18T23:17:55Z")

</div>

Hi @tihomir, thanks for your reply. I am still new to temporal and still evaluating the framework. I assume there should be a server hosting the workflow, and in this case it is service A. My use case is pretty generic, you start the whole workflow in one service, and call another service to do something asynchronously. Instead of polling service B for result, I’d like service B to send a signal to the workflow engine so the workflow could continue. Given I don’t want to introduce any temporal dependencies in service B so prefer to do a http call instead of using client sdk. Am I making sense here? ChatGPT advised that Temporal provides a REST API endpoint to send signals to running workflows, and you could do something like

```auto
POST /api/workflows/v1/{namespace}/{workflow-type}/{workflow-id}/signal/{signal-name}

```

Just to be clear, I am looking for REST APIs available out of the box. Similar to Camunda REST APIs: [Camunda Platform REST API](https://docs.camunda.org/rest/camunda-bpm-platform/7.20-SNAPSHOT/#tag/Message/operation/deliverMessage)

Could you please help to confirm this is the right approach?

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [April 19, 2023, 2:38pm UTC](https://community.temporal.io/t/is-that-possible-to-send-signal-to-a-temporal-workflow-through-rest-api/7953/6 "2023-04-19T14:38:08Z")

</div>

We plan to provide REST APIs out of the box. But it is not currently available. You have to write your own HTTP handler. In most cases, you don’t want to expose Temporal specific APIs, so this handler is usually application specific and doesn’t even mention Temporal abstractions like signals and workflows.

---

<div class="post-metadata">

**Author:** ![lorensr](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/lorensr/32/1709_2.png) [@lorensr](https://community.temporal.io/u/lorensr)\
**Post date:** [April 20, 2023, 4:31am UTC](https://community.temporal.io/t/is-that-possible-to-send-signal-to-a-temporal-workflow-through-rest-api/7953/7 "2023-04-20T04:31:43Z")

</div>

> [@Chris\_Zhao](#):
>
> Given I don’t want to introduce any temporal dependencies in service B so prefer to do a http call instead of using client sdk.

The Server currently only has a [gRPC API](https://github.com/temporalio/api/blob/readme/README.md), so the 3 options are:

1. Client SDK (which isn’t a big library—it just wraps our gRPC API and does things for you like data conversion)
2. Call gRPC API directly (recommend #1 over this, as Client is easier to use)
3. Develop and deploy your own HTTP API, which uses #1 or #2

For #2, you’d call the `WorkflowService.SignalWorkflowExecution` method with this input:

[SignalWorkflowExecutionRequest](https://api-docs.temporal.io/#temporal.api.workflowservice.v1.SignalWorkflowExecutionRequest)

> and call another service to do something asynchronously. Instead of polling service B for result

This doesn’t fit your no-dependencies need, but perhaps worth noting that this is one of the use cases we have AsyncCompletionClient for. The workflow can start an activity that calls service B, and service B completes the activity using an AsyncCompletionClient.

---

<div class="post-metadata">

**Author:** ![Chris\_Zhao](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chris_zhao/32/3641_2.png) [@Chris\_Zhao](https://community.temporal.io/u/Chris_Zhao)\
**Post date:** [April 20, 2023, 5:00am UTC](https://community.temporal.io/t/is-that-possible-to-send-signal-to-a-temporal-workflow-through-rest-api/7953/8 "2023-04-20T05:00:20Z")

</div>

Thanks a lot @maxim and @lorensr. This is very helpful

---

<div class="post-metadata">

**Author:** ![noxasaxon](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/noxasaxon/32/2881_2.png) [@noxasaxon](https://community.temporal.io/u/noxasaxon)\
**Post date:** [April 21, 2023, 1:08am UTC](https://community.temporal.io/t/is-that-possible-to-send-signal-to-a-temporal-workflow-through-rest-api/7953/9 "2023-04-21T01:08:50Z")

</div>

I made a generic API gateway server for doing this via REST, and it has extra routes for interacting with slack webhooks and routing them back to the workflow.

This enables not only your current use case but also provides patterns for usage when you don’t have control over a 3rd party service (other than telling it where to send an event payload) but need interactivity with external users/services from a temporal workflow

> **[GitHub - noxasaxon/temporal\_apig](https://github.com/noxasaxon/temporal_apig)**
>
> Contribute to noxasaxon/temporal\_apig development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [April 21, 2023, 1:25am UTC](https://community.temporal.io/t/is-that-possible-to-send-signal-to-a-temporal-workflow-through-rest-api/7953/10 "2023-04-21T01:25:56Z")

</div>

BTW in the long term, we do plan to provide use-case-specific HTTP and other APIs through [Nexus](https://github.com/temporalio/proposals/tree/master/nexus) gateways.

---

<div class="post-metadata">

**Author:** ![noxasaxon](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/noxasaxon/32/2881_2.png) [@noxasaxon](https://community.temporal.io/u/noxasaxon)\
**Post date:** [April 21, 2023, 1:45am UTC](https://community.temporal.io/t/is-that-possible-to-send-signal-to-a-temporal-workflow-through-rest-api/7953/11 "2023-04-21T01:45:16Z")

</div>

That’s great, I’m super excited about nexus. Hopefully I can deprecate this or at least just keep the slack encoding & forwarding route
