# How can I create Blueprints with multiple exec output pins in C++?

**URL:** <https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 28, 2014, 5:30am UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885 "2014-04-28T05:30:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_91428f0a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_91428f0a](https://forums.unrealengine.com/u/anonymous_user_91428f0a)\
**Post date:** [April 28, 2014, 5:30am UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/1 "2014-04-28T05:30:26Z")

</div>

How can I create a blueprint node in C++ that has multiple exec output pins, like the Branch node or the Cast To ones.

---

<div class="post-metadata">

**Author:** ![MattCan36](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MattCan36](https://forums.unrealengine.com/u/MattCan36)\
**Post date:** [April 28, 2014, 5:42am UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/2 "2014-04-28T05:42:27Z")

</div>

I used the Sequence node in Utilies-\>Flow Control and you can keep adding pins. It will execute the first, then the second, then the third. This is really useful for setting up complicated gameplay where you need to branch your blueprint to a bunch of different areas.

It’s even easier if the order doesn’t matter, it’ll just do all of it (still technically in order but it won’t matter).

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4b90fa9e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4b90fa9e](https://forums.unrealengine.com/u/anonymous_user_4b90fa9e)\
**Post date:** [September 6, 2014, 6:43am UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/3 "2014-09-06T06:43:23Z")

</div>

I am also interested in a real answer to this question, If it is possible or not via the UFUNCTION macro.

Looking into how the Branch and Sequences are created seem to use CreatePin() but finding out how to do this out side this namespace is driving me nuts ☹

---

<div class="post-metadata">

**Author:** ![veggiesaurus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@veggiesaurus](https://forums.unrealengine.com/u/veggiesaurus)\
**Post date:** [September 6, 2014, 11:10am UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/4 "2014-09-06T11:10:19Z")

</div>

Also bumping this, there must be a way!  
I’m specifically wanting to implement a “branch on clamp” node, with three outputs for a) the input value being between A & B; b) the input value is above B; c) the input value is below B.  
I know I could do it with a couple of branches and comparitors, but I plan to use it a lot, so a single node would be great.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4b90fa9e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4b90fa9e](https://forums.unrealengine.com/u/anonymous_user_4b90fa9e)\
**Post date:** [September 7, 2014, 7:21am UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/5 "2014-09-07T07:21:53Z")

</div>

Thanks this seems to be the immediate solution of course but as stated above would be cool if this could be added as a potential feature. It seems the functionality is there in the engine, so technically it isn’t impossible, just not through the use of the UFUNCTION macro. If i figure it out I will be sure to post it.

---

<div class="post-metadata">

**Author:** ![TheFoyer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheFoyer](https://forums.unrealengine.com/u/TheFoyer)\
**Post date:** [December 31, 2014, 4:10am UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/6 "2014-12-31T04:10:04Z")

</div>

I’d like to have Exec pins for OnSuccess and OnFailure for an HTTP call like when using the session nodes.

---

<div class="post-metadata">

**Author:** ![Baribal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Baribal](https://forums.unrealengine.com/u/Baribal)\
**Post date:** [February 3, 2015, 10:22am UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/7 "2015-02-03T10:22:29Z")

</div>

I found [https://docs.unrealengine.com/latest/INT/API/Editor/BlueprintGraph/UK2Node\_ExecutionSequence/AddPinToExecutionNode/index.html](https://docs.unrealengine.com/latest/INT/API/Editor/BlueprintGraph/UK2Node_ExecutionSequence/AddPinToExecutionNode/index.html) but this requires your node to be its own class as far as i understand. So you could make your function a class that is a child of UK2Node\_ExecutionSequence but i don’t believe thats recommendable.

We have to hope that Epic makes this into a nice and easy to use macro. As far as i can tell Frozenfire has provided the best workaround.

---

<div class="post-metadata">

**Author:** ![MickD777](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MickD777](https://forums.unrealengine.com/u/MickD777)\
**Post date:** [February 3, 2015, 2:19pm UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/8 "2015-02-03T14:19:50Z")

</div>

Thanks for that, really useful 🙂

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [February 3, 2015, 2:29pm UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/9 "2015-02-03T14:29:42Z")

</div>

Oh didnt know about this one

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [February 3, 2015, 2:38pm UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/10 "2015-02-03T14:38:16Z")

</div>

You can also create custom node by exteding UK2Node class, it let you do anything with pins and apperence of node. Thing is theres no documentation on it and you need to figure this yourself, its complex but always a option. All nodes are made like that (in fact funtion bind node is K2Node\_CallFuntion), you can find code of them here:

[https://github.com/EpicGames/UnrealEngine/tree/890cefeee330dec714271af1cd07969f0a60848e/Engine/Source/Editor/BlueprintGraph/Private](https://github.com/EpicGames/UnrealEngine/tree/890cefeee330dec714271af1cd07969f0a60848e/Engine/Source/Editor/BlueprintGraph/Private)

---

<div class="post-metadata">

**Author:** ![MarcAndreG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MarcAndreG](https://forums.unrealengine.com/u/MarcAndreG)\
**Post date:** [February 4, 2015, 6:09pm UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/11 "2015-02-04T18:09:53Z")

</div>

Worked like a charm. Only had to change _“enum class EMyEnum : uint8”_ to _“enum EMyEnum”_ since it caused an error when casting from uint8 to TEnumAsByte

---

<div class="post-metadata">

**Author:** ![NeroViper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NeroViper](https://forums.unrealengine.com/u/NeroViper)\
**Post date:** [April 2, 2015, 1:16pm UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/12 "2015-04-02T13:16:27Z")

</div>

I get generated error in the compiler about TEnumAsByte failing to with EMyEnum and MarcAndreG solution get another error about missing {

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_80d7367e1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_80d7367e1](https://forums.unrealengine.com/u/anonymous_user_80d7367e1)\
**Post date:** [October 24, 2015, 5:14pm UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/13 "2015-10-24T17:14:27Z")

</div>

Hm, I was thinking about doing this for my project, but I think, that I should do this after the blueprints are compiled into C++ Code and after Blueprints are stored as textfiles

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [November 24, 2015, 1:10am UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/14 "2015-11-24T01:10:05Z")

</div>

Actually, the form with **: uint8** is the new and better one. This way you can convert any enum to an integral type using C-style cast like _(int32)EMyEnum::BranchA_.

You can remove the cast with TEnumAsByte and simply use the enum type name. Like so:

```
// .h

UENUM(BlueprintType)
enum class EMyEnum : uint8
{
	BranchA,
	BranchB
};

UFUNCTION(BlueprintCallable, Category = "Stuff", Meta = (ExpandEnumAsExecs = "Branches"))
void DoSomeBranch(int32 SomeInput, EMyEnum& Branches)

// .cpp

void AMyClass::DoSomeBranch(int32 SomeInput, EMyEnum& Branches)
{
	if (SomeInput == 1)
	{
		Branches = EMyEnum::BranchA;
	}
	else
	{
		Branches = EMyEnum::BranchB;
	}
}
```

---

<div class="post-metadata">

**Author:** ![Eymrich](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Eymrich](https://forums.unrealengine.com/u/Eymrich)\
**Post date:** [May 2, 2016, 12:59pm UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/15 "2016-05-02T12:59:28Z")

</div>

I got errors with the early method. This solution instead worked fine!  
If can help, i just used it in a public class with static methods(a function library).

---

<div class="post-metadata">

**Author:** ![thejohncrafter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thejohncrafter](https://forums.unrealengine.com/u/thejohncrafter)\
**Post date:** [May 16, 2016, 11:31am UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/16 "2016-05-16T11:31:55Z")

</div>

Actually, AddPinToExecutionNode is called by [SGraphNodeK2Sequence](https://github.com/EpicGames/UnrealEngine/blob/dff3c48be101bb9f84633a733ef79c91c38d9542/Engine/Source/Editor/GraphEditor/Private/KismetNodes/SGraphNodeK2Sequence.cpp#L39).  
There are two ways for you to get a similar behavior : extending SGraphNode\_K2Sequence or implementing [CreateVisualWidget](https://github.com/EpicGames/UnrealEngine/blob/dff3c48be101bb9f84633a733ef79c91c38d9542/Engine/Source/Runtime/Engine/Classes/EdGraph/EdGraphNode.h#L494).  
You have to create your own implementation of SGraphNode (there is no need to implement SGraphNodeK2Base) - copy code from [SGraphNodeK2Sequence](https://github.com/EpicGames/UnrealEngine/blob/dff3c48be101bb9f84633a733ef79c91c38d9542/Engine/Source/Editor/GraphEditor/Private/KismetNodes/SGraphNodeK2Sequence.h).

But I can’t find a way to implement the “remove pin” button. This has something to do with _FUICommandList_ and _FGraphEditorCommands::Get().RemoveExecutionPin_, but I don’t now how to handle this stuff. If someone could help me ?

---

<div class="post-metadata">

**Author:** ![Evigmae](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/evigmae/32/1187349_2.png) [@Evigmae](https://forums.unrealengine.com/u/Evigmae)\
**Post date:** [January 5, 2019, 6:03pm UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/17 "2019-01-05T18:03:24Z")

</div>

Also, blueprints don’t show the name of exec pins named “Then”

![264296-0.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/d/e/fde117fa3d1c53a553d9bc7b209203851a0a7c13.png)

![264297-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/0/f/c0f3ce3b22bc9e3d2dcfa201a321cf9c711c92e2.png)

Which is also true for pins from Blueprint created Functions and Macros by the way.

In-Exec pins named “Execute” also won’t show the name.

---

<div class="post-metadata">

**Author:** ![MichaelWion](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MichaelWion](https://forums.unrealengine.com/u/MichaelWion)\
**Post date:** [February 26, 2019, 6:30am UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/18 "2019-02-26T06:30:55Z")

</div>

@Evigmae haven’t tested, but wouldn’t this do the trick?

```
UENUM(BlueprintType)
enum class EMyEnum : uint8
{
    Then UMETA(DisplayName = "Then"),
    Success UMETA(DisplayName = "On Success"),
    Fail UMETA(DisplayName = "On Failure")
};
```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d63df128](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d63df128](https://forums.unrealengine.com/u/anonymous_user_d63df128)\
**Post date:** [November 27, 2019, 3:32am UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/19 "2019-11-27T03:32:34Z")

</div>

you rock!!

---

<div class="post-metadata">

**Author:** ![auxxxx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@auxxxx](https://forums.unrealengine.com/u/auxxxx)\
**Post date:** [May 3, 2022, 8:37pm UTC](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885/20 "2022-05-03T20:37:05Z")

</div>

Just wanted to say I found this super helpful. Thank you!

[Next page](https://forums.unrealengine.com/t/how-can-i-create-blueprints-with-multiple-exec-output-pins-in-c/281885.md?page=2)
