# Inline protobuf

Named declarations accept type proto or b64. Proto contains complete inline
protobuf source; b64 contains a base64 FileDescriptorSet, allowing whitespace.
Exact XML and decoded proto text survive round trips. Descriptor bytes are a
replaceable compiled result. Proto2 and proto3 descriptor syntax is supported.

```xml
<integration id="com.example.protobuf" version="1.0.0" sdk-version="2.0">
  <protobuf><declaration name="event" type="proto"><![CDATA[
syntax = "proto3";
package example;
message Event { string id = 1; }
]]></declaration></protobuf>
</integration>
```

Other inline proto declarations may be imported by their name.proto filename.
External imports, system includes and supporting files are unavailable.
Compilation has a five-second time limit. Each
source or decoded descriptor is limited to 256 KiB; diagnostics to 64 KiB.

Call ctx.protobuf.decode with descriptorName:messageFQN and a base64
payload. For this example the reference is event:example.Event. Check its success
flag and then use the JSON value. Names are validated at compile time. Decode
payloads and results are limited to 256 KiB and use integration-private descriptors.