<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0306</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2018-06-29</periodOfReport>

    <notSubjectToSection16>1</notSubjectToSection16>

    <issuer>
        <issuerCik>0001374690</issuerCik>
        <issuerName>ZAFGEN, INC.</issuerName>
        <issuerTradingSymbol>ZFGN</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001346450</rptOwnerCik>
            <rptOwnerName>Atlas Venture Fund VII L P</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>25 FIRST STREET, SUITE 303</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>CAMBRIDGE</rptOwnerCity>
            <rptOwnerState>MA</rptOwnerState>
            <rptOwnerZipCode>02141</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>0</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>1</isTenPercentOwner>
            <isOther>0</isOther>
        </reportingOwnerRelationship>
    </reportingOwner>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001377726</rptOwnerCik>
            <rptOwnerName>Atlas Venture Associates VII, L.P.</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>25 FIRST STREET, SUITE 303</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>CAMBRIDGE</rptOwnerCity>
            <rptOwnerState>MA</rptOwnerState>
            <rptOwnerZipCode>02141</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>0</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>1</isTenPercentOwner>
            <isOther>0</isOther>
        </reportingOwnerRelationship>
    </reportingOwner>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001377725</rptOwnerCik>
            <rptOwnerName>Atlas Venture Associates VII, Inc.</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>25 FIRST STREET, SUITE 303</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>CAMBRIDGE</rptOwnerCity>
            <rptOwnerState>MA</rptOwnerState>
            <rptOwnerZipCode>02141</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>0</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>1</isTenPercentOwner>
            <isOther>0</isOther>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2018-06-29</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>J</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F1"/>
            </transactionCoding>
            <transactionTimeliness>
                <value></value>
            </transactionTimeliness>
            <transactionAmounts>
                <transactionShares>
                    <value>1126546</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                    <footnoteId id="F1"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>3506184</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                    <footnoteId id="F3"/>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2018-06-29</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>J</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F2"/>
            </transactionCoding>
            <transactionTimeliness>
                <value></value>
            </transactionTimeliness>
            <transactionAmounts>
                <transactionShares>
                    <value>234321</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                    <footnoteId id="F1"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>11</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                    <footnoteId id="F4"/>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">On June 29, 2018, Atlas Venture Fund VII LP (&quot;Atlas Venture VII&quot;) distributed, for no consideration, 1,126,546 shares of the Issuer's Common Stock, pro-rata, to its partners, including its limited partners and its general partner, in accordance with the exemptions afforded by Rule 16a-9 and Rule 16a-13 of the Securities Exchange Act of 1934, as amended.  The distribution was effected pursuant to a Rule 10b5-1 plan adopted by Atlas Venture VII on December 22, 2017.</footnote>
        <footnote id="F2">On June 29, 2018, Atlas Venture Associates VII LP (&quot;AVA VII LP&quot;), the general partner of Atlas Venture VII distributed, for no consideration, 234,421 shares of the Issuer's Common Stock, pro-rata, to its partners, including its limited partners and its general partner, in accordance with the exemptions afforded by Rule 16a-9 and Rule 16a-13 of the Securities Exchange Act of 1934, as amended.  The distribution was effected pursuant to a Rule 10b5-1 plan adopted by AVA VII on December 22, 2017.</footnote>
        <footnote id="F3">These shares are held directly by Atlas Venture VII. The general partner of Atlas Venture VII is AVA VII LP, and the general partner of AVA VII LP is Atlas Venture Associates VII, Inc. (&quot;AVA VII Inc.&quot;).  AVA VII LP and AVA VII Inc. disclaim Section 16 beneficial ownership of such shares, except to the extent of a pecuniary interest, if any, therein.  This report shall not be deemed an admission that the reporting persons are the beneficial owners of such securities for the purposes of Section 16 or for any other purpose.</footnote>
        <footnote id="F4">These shares are held directly by AVA VII LP.  The general partner of AVA VII LP is AVA VII Inc.  AVA VII Inc. disclaims Section 16 beneficial ownership of such shares, except to the extent of a pecuniary interest, if any, therein.  This report shall not be deemed an admission that the reporting person is the beneficial owner of such securities for the purposes of Section 16 or for any other purpose.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>By: Atlas Venture Fund VII LP, By: Atlas Venture Associates VII, L.P., its general partner, By: Atlas Venture Associates VII, Inc., its general partner, /s/ Frank Castellucci, Secretary</signatureName>
        <signatureDate>2018-07-03</signatureDate>
    </ownerSignature>

    <ownerSignature>
        <signatureName>By:  Atlas Venture Associates VII, L.P., By: Atlas Venture Associates VII, Inc., its general partner, /s/ Frank Castellucci, Secretary</signatureName>
        <signatureDate>2018-07-03</signatureDate>
    </ownerSignature>

    <ownerSignature>
        <signatureName>By:  Atlas Venture Associates VII, Inc., /s/ Frank Castellucci, Secretary</signatureName>
        <signatureDate>2018-07-03</signatureDate>
    </ownerSignature>
</ownershipDocument>
